Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppCache Manifest Error

Edit: I had to remove some links.

My manifest page seems to be causing errors on my web page. When you first go to the page everything appears to cache successfully, but upon refresh it fails to get files that exist.

I made a quick test page to check out, here.

Here is my manifest file.

This is a VERY dynamic site by php & javascript, I haven't got too much into appcache with those factors, so I'm unsure if the issue has to do with the fact that so much content has to be conditionally set in.

Any help would be greatly appreciated. NOTE: Java-Console will be needed (best used in Chrome).

UPDATE: It seems that if any file is, so much, as linked to a manifest file it receive GET errors.

The Java-Console for a page that is linking to an empty manifest (while online) reads the following, after successful caching:

> Creating Application Cache with manifest
> https://www.url.org/text/cache-manifest/manifest.appcache Application
> Cache Checking event Application Cache Downloading event JQMIGRATE:
> Logging is active Application Cache Progress event (0 of 0)
> Application Cache Cached event  GET
> https://www.domain.org/images/backgrounds/gradient.png net::ERR_FAILED
> GET https://www.domain.org/javascripts/pop_ups.js?_=1393453024093 GET
> https://www.domain.org/javascripts/jquery_plugins/jquery.placeholder.js?_=1393453024094

Warmth.

like image 752
Crystal Miller Avatar asked Feb 26 '14 18:02

Crystal Miller


People also ask

How do I clear manifest cache?

The best you can do is explicitly tell the browser to remove all the cached files - a manifest with just a network section should delete all the other files, but the file with the manifest reference will itself always be cached.

What is an AppCache file?

The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users. Your app will load and work correctly, even if the user presses the refresh button while they're offline.

What is a benefit of using AppCache?

The Application Cache (AppCache) API allows offline access to your application by providing the following benefits: Performance - Specified site resources come right from disk, avoiding any network trips. Availability - Users can navigate to your site when they are offline.

What is the purpose of AppCache API in HTML5?

HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Application cache gives an application three advantages: Offline browsing - users can use the application when they're offline. Speed - cached resources load faster.


1 Answers

I solved my own issue. I re-read some of the old articles that first taught me about appcache. Turns out it was Gotcha #5.

GOTCHA #5: NON-CACHED RESOURCES WILL NOT LOAD ON A CACHED PAGE If you cache index.html but not cat.jpg, that image will not display on index.html even if you’re online. No, really, that’s intended behaviour, see for yourself.

To disable this behaviour, use the NETWORK section of the manifest

CACHE MANIFEST
# v1index.html
NETWORK:
*

The * indicates that the browser should allow all connections to non-cached resources from a cached page. Here, you can see it applied to the previous example. Obviously, these connections will still fail while offline.

I added the following to my manifest & now everything is well. Woo-hoo.

like image 174
Crystal Miller Avatar answered Oct 05 '22 19:10

Crystal Miller