I'm working on this web app for which I'd like to cache some static content to lower loading times on a slow connection. Other parts are being generated through PHP and AJAX and can therefor not be cached.
I'm successfully using the cache.manifest to cache the static content, such as images, but I notice that the dynamic pages aren't using them. Instead they are downloading the images again, even though they have been cached, making the caching useless.
Because my dynamic content is generated based on GET-requests the dynamic pages are in the NETWORK section of the manifest (e.g. "user?*"). Might that have something to do with it? Is there a way to maybe force using cached images?
Note: the exact full reference to the dynamic pages (e.g. "user?id=22") is of course not in the manifest. Does that make the cache unreachable for those pages?
Seems I've come up with my own solution.
Since caching dynamic pages (e.g. "user.php?id=22") broke my application I tried inserting an iframe containing a reference to the manifest instead of referencing it on the page itself. That did not seem to do it for me.
I now include an explicit reference with a wildcard to the dynamic pages in the CACHE section of the manifest. That does seem to work. They are now not getting cached entirely with parameters et al. (so the application remains functional) but are using the cached images. Might not be ideal but seems to be a pretty simple solution.
I have not yet tried removing those iframes but my guess is that they can be removed.
CACHE MANIFEST
./user.php
./user.php?*
etc...
NETWORK:
./db_connect.php
etc...