Writing a cache manifest file for a WordPress blog (app cache, offline web applications)

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?

1 Answer
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.

Leave a Comment