HTML5 Application Cache manifest file location on hard drive - html

I have a site which uses HTML5 App Cache and I'm having trouble determining why the cache update started. I haven't made changes or added/removed files.
The manifest file is generated dynamically and includes all files from the app's folder, except a few which should not be cached. I would like to check the cached manifest file to see what is the difference between it and the current version.
How do the browsers store the manifest file so they are able determine when it has changed and when should the cache update kick in ?
Can this file be found somewhere on the hard drive in the browser's cache folder ?

Yes they have to. How it should work otherwise? Stored in RAM it would be lost after reboot and stored only in web could not lead to an offline app.
But where they store them and if they are encrypted is another question. In Firefox: C:\Users\brach\AppData\Local\Mozilla\Firefox\Profiles\xxxxx.default\OfflineCache\0\9\77546B5B27E111-0
The content of that file is
CACHE MANIFEST
CACHE:
style.css
script.js
index.htm
So that's a manifest how we know it. But for other browsers you have to explore it by yourself... ;)
In Firefox you can easily find it out entering about:cache as URL and look in Offline cache device section.
In chrome you can enter chrome://appcache-internals as URL and let you show the content of any cached file including the manifest directly in the browser.

Related

What is the refresh rate of a manifest file?

I have a really simple manifest file for caching my entire App. It works pretty well, even when offline.
But, after a long time without using it, and I go and open it again, the App starts downloading EVERYTHING, even when the cache file is the SAME as before!
So, does it have any way to block the automatic update of the browser? I mean, I only want it to download the files again when my manifest file is modified.
Thanks!

Google Drive Offline Document File Location

Has anyone discovered where/how offline Google Documents are stored when using Google Drive in Chrome? They must be stored locally but where?
Have tried the browser cache etc but can't see it unless I'm missing something very obvious!
To clarify, the file that is stored within 'My Documents/Google Drive' is a text file with a URL, what I am looking for is where the file that the URL points to is held when in offline mode.
It turns out the offline documents are stored in the HTML5 FileSystem.
The Chrome FileSystem storage is located here on my Windows 7 machine:
C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\File System
I added a number of large images to a document with the Chrome "Offline Docs" enabled and was able to see the FileSystem storage directory grow appropriately.
I then used the HTML5 FileSystem Explorer extension for Chrome to view the file structure of an offline document and was able to confirm that the images were, indeed being retrieved from the HTML5 FileSystem when Chrome was offline. See screenshot:
Further, it may interest you, the location where Google Drive stores offline docs in Android's file system.
sdcard/android/data/com.google.android.apps.docs/
Google Drive uses Chrome's IndexedDB for storing data about files. To see the contents, open developer console (Ctrl + Shift + I) and choose Resources tab.
This answer tells you about actual location of IndexedDB in the file system on Windows.
On Linux it's: ~/.config/google-chrome/Default/IndexedDB
On my computer (Windows 8.1 / Chrome version 41.0.2272.101 m) I found the filesystem at "C:\Users\my username\Appdata\Local\Google\Chrome\User Data\Profile 1\File System"
I needed to find it because I had some corrupted images in Google Slides (they worked on other computers or other browsers on my computer, just not in chrome on my computer). I deleted the File System directory and shazam, the images reloaded and were no longer corrupted.
Mine were all stored in
C:\users\%username%\Google Drive\
Have you downloaded Google Drive?
Offline access is available only when you’re using Chrome. See Setup Offline Access and Google Docs Offline. It seems like offline documents are encoded by Chrome and stored at some secret places, in order to force you to use Chrome.
Google drive stores the offline files in a folder called... android/data/com.google.android.apps.docs/files/pinned_docs_files_do_not_edit/
in that folder u will find the desired files.
Please be aware that...
The files that you will find can be of two formats..
1) encrypted
2) open type
If you have left unchecked the option to encrypt (by default in google drive) the files that u downloaded will be visible, but not accessible by the standard reader. every attempt to read it will be result in a failed operation.
But ... if you DISABLED the encryption in google drive, u will be able to open freely with any type of reader.

Change in cache-manifest file

Whenever there is a change in cache-manifest file i.e. a resource is changed, do I need to redeploy my web application on server or can I update the files dynamically i.e. is there any way to update the files dynamically when the server is running.
Assuming you are talking about the HTML5 cache manifest for an offline web application -- when you modify the cache-manifest file, all of the assets listed in the manifest are re-downloaded to the client browser when they access it next. There is no way to selectively update individual files in the cache. It's all or nothing unfortunately.
Also, I've found the the file containing the is automatically cached even if it's not listed in the manifest. When the manifest changes, this file is replaced, but only after it's loaded... so it effectively requires an additional refresh to see the changes. I've seen various JavaScript hacks to force a reload if the cache updates.
I wrote a fairly extensive blog post on html5 app cache and the various aspects of the manifest file at http://gregsramblings.com/2012/05/28/html5-application-cache-how-to/

Removing HTML5 Offline AppCache

I have an HTML document with an associated appcache manifest. But now I want to get rid of offline application caching for a while.
If I remove mention of the manifest from the <html> tag, browsers that already have a cached version will continue to use that cached version.
If I update the appcache manifest, well, whatever, there is still an appcache.
What is the most sensible way to go about removing offline application caching? I suppose that I could just change the manifest to have no entries other than:
NETWORK:
*
Then it won't actually cache anything.
But surely there must be a way to get rid of the appcache and the manifest file altogether, no?
You simply need to remove the appcache manifest from your server. If the browser can't access the manifest file, it will stop caching your app and remove all cached data.
Some useful information from two sites:
If the manifest file itself can't be retrieved, the cache will ignored
and all cached data associated with it will be disregarded.
http://appcache.offline.technology/
Application caches can also become obsolete. If the manifest is
removed from the server, the browser removes all application caches
that use that manifest, then sends an "obsoleted" event to the
application cache object. Then the application cache's status is set
to OBSOLETE.
https://developer.mozilla.org/en/Offline_resources_in_Firefox
FOR anyone coming across this question and who've deleted the appcache manifest, deleted the browser's cache and removed the manifest from the server and the reference to it in the HTML: If this still did not cause your HTML document to load the update version in Google Chrome, you can go to chrome://appcache-internals/ in your browser and click REMOVE next to the manifest you wish to get rid of.
Manually delete app cache: Only for Chrome
Enter the follow URL in your chrome browser: chrome://appcache-internals/
There you will see a list of every application cache you have in storage with the possibility to remove any of them.
Reference
In modern Firefox you can manipulate the offline cache with Edit Preferences Advanced Network.
In windows it is now (v27.01) Tools Options Advanced Network

How do I create a link to a saved html page on my computer?

I'm working on a web application that caches html pages and saves it on the user's computer. I want to create a link, so that the user can click on the link and access the cached webpage.
Following is my link to a cached page:
BBC
When I click on the link, nothing happens. I'm not even getting any error.
Can someone please suggest how to create a link to a cached html page?
First of all, not all browsers handle local files equally, indeed, not all computers will be running windows or have a C: drive. Secondly, you don't have much control over a user's cache. Cached pages are usually handled by the browser automatically. You can use headers to specify how a browser ought to cache files, but it's not even required to do so. You can read the W3C recs on caching for more information.
It's unclear what you're trying to do here, but it sounds like it might make more sense for you to use HTML5 local storage or offline files than trying to mess around with their file system directly. The security model of most browsers is such that web apps don't interact with local files, which may be why it's not working for you with your current setup. Dive Into HTML5 has a good overview of HTML5 local storage and offline pages.
Edited based on comment below:
Most browsers' security settings won't let a page on a website access files stored locally. Only locally saved files can link to other locally saved files. Therefore, if the page with a link is on a website, your link won't work. Try creating a link to your file from another locally stored file and see if that works.
Instead of providing the .html extension in the main page where you provide the link you should do something as below:
< href="file:///C:/Users/xxx/yyy/bbc">BBC</a>