3

I'm wondering if anyone has implemented Offline Web Applications from HTML5 in a WordPress blog?

When you write a manifest file, all files must be accounted for, thought you can specify the wildcard * in the NETWORK section. So, given how MANY files and dirs makeup a typical WordPress install, does anyone have guidance on which files/dirs should be cached, and which can be fetched from the network?

Here's what I figure I need in the CACHE (explicit) section:

  • the theme I'm using (so wp-content/theme/theme-name & associate files)
  • wp-content/uploads/ + everything inside

Here's what I'm thinking of leaving OUT of the cache (i.e being caught by the * in the NETWORK section):

  • the wp-admin/ folder and all its content
  • wp-content/upgrade/
  • wp-content/plugins/

I'm unsure whether to cache anything in the wp-includes/ folder or not.

The other problem I foresee is that since the uploads/ file will be changing as images are added, I am going to have to update my cache.manifest for each new piece of content -- unless I am ok with that images/video/whatever not caching.

Any thoughts on this from someone who's done it, or been thinking about doing it?

2
  • I'm looking at building a html5 app based of a WP site too but I'm at the same stages as you. Surely you dont want to cache every image in the content dir. the manifest file should contain your css/js/theme image files and thats about it. Then your JS will load in other images as and when they need to be displayed. If you have proper expiry headers set on images then the browser should cache them. The idea of the manifest file is to just load and save the needed files for a working app where an internet connection may not be available.
    – Scott
    Commented Jun 23, 2011 at 22:17
  • Thanks, Brady, good point on the uploads/ dir. I'm just going ahead with this, what I've done thus far is edit the header.php file to point to my manifest, and created a simple manifest with js/css/images from the theme and a few things from my sidebar. So far so good, but I'd like to optimize as much as possible and wonder what, if any, WP php files should be cached.
    – alexisgo
    Commented Jun 23, 2011 at 23:53

1 Answer 1

1

I'm in the same boat, and I'm still figuring out what the best "approach" should be.

It is not necessary to cache any of the Wordpress core files (/wp-includes, /wp-admin, etc). You will have to cache some files that live in your theme. Stuff like the css, js, and any image resources you use in the UI. I created a little plugin that you can use to manage what files your cache manifest contains through the context of wp-admin. Let me know if you find it to be helpful.

1
  • Many themes + plugins use the copy of jquery that is included with wordpress and that's located in wp-includes. Does the plugin look at the registered scripts and styles? Commented Dec 1, 2011 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.