I have the following appcache manifest:
CACHE MANIFEST
# Cache Manifest timestamp: 1361723106
CACHE:
offline.html
offline2.html
offline.manifest.php
NETWORK:
*
FALLBACK:
/ offline.html
I am using this on my local installed server.
So when I load the index.html file which links to this manifest file, the consolse in Chrome shows me that all files are cached properly. When I now shut down my local server and try to access the index.html file again, then I see the content of that index.html file. I was expecting to be "forwarded" to offline.html. What am I doing wrong?
Thanks in advance!
Although you speak of an "index.html" file, I'm assuming you're accessing the resource like this: http://yourlocalservername/ .
The resource that links to the appcache manifest (in this case "/") is always included in the application cache. Fallback applies to resources which are not in the cache, so the result you get is expected.
The only way to show an "offline indicator" when accessing a previously cached resource, is to ensure the cached resource includes javascript code that actually checks if the browser is offline. You could check navigator.onLine and/or check with XMLHttpRequest to see if your server is reachable (and functioning).
Related
File manifest.php contains data
ACHE MANIFEST
index.html
page.html
category.html
If I change name of manifest.php to new_manifest.php, will it re-cache files or use the earlier cached data?
If you change the name of the manifest file so the old manifest is not found on server anymore then the cache will be dropped and all files will be loaded from server.
Depending on how the new files and manifest are then they will be re-cached.
I have cache static resources of my website using manifest file
But when I run website when internet is not connected images not shown.
Images also should cache because I putted them in manifest file.
For example I have cached this file but this file is not loaded when the Internet is disconnected.
Here is google chrome console snapshot :
I also had the same problem. I included below in the cache.manifest file & it fixed for me.
NETWORK:
*
Its strange ..
The problem resolved just when I changed images folder name !
I have a properly generated cache.manifest file.
I have ensured that it is being served with the correct mimetype.
I have an index.jsp file which correctly references the cache.manifest file.
I have set up Tomcat so that if I hit http://example.org/ it will load index.jsp
When I hit http://example.org/index.jsp
The cache.manifest is read, processed and works! Chrome shows all of the caching events.
Repeated visits show the Application Cache Checking event, Application Cache NoUpdate events in Chrome
When I hit http://example.org/
The browser acts as if there is no cache.manifest at all!
There are not cache events sent to the Chrome console
Is there a trick to get an index.jsp file auto redirected to by Tomcat, to use the html cache manifest?
I am hosting a cache manifest file for a friend, because his server serves manifest files as plain text and he can't change it. He's hosting the rest of his pages himself, on his server. So his <html> tag has a manifest attribute that is a complete URL that points to my server.
But it doesn't seem to be working. Is this because the cache manifest file is from a different host as the web page that it is in?
The manifest attribute can point to an absolute URL or relative path, but an absolute URL must be under the same origin as the web application
Source.
I am working on an offline application in HTML and am having a problem using the HTML5 manifest. I am able to get it to download all the files and the manifest but when I change the manifest it does not do an update.
I see a record of the browser downloading the manifest in the web server log, and it does issue a bunch of progress events. However there is no record in the web server log of it downloading any of the files listed in the manifest nor do any changes show up in the browser.
This is with firefox 3.6.4.
Any ideas?
The manifest itself is still subject to normal browser caching rules, make sure you serve the manifest files with an expiry header set to immediate. You can do this on Apache in .htaccess with this:
<IfModule mod_expires. c>
ExpiresActive on
ExpiresByType text/cache-manifest “access plus 0 seconds”
</IfModule>
In the short term, try hitting Ctrl+F5 to force a full reload or clearing your browser cache.