What is the refresh rate of a manifest file? - html

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!

Related

How do I refresh data on my website on AWS S3?

I am working on a pretty basic website where I am updating csv files which I display as tables using html/bootstrap. My problem is that even though I update the csv file the html pages are not updating. Also this is really inconsistent being that some html pages will update and others will not. I am trying to figure out when S3 decides to update changes or if I can do so manually. I should mention that I am routing the domain to S3 from namecheap.com.
Thank you in advance I am still very new to AWS.
S3 updates reflect immediately when you request downloads again.
The issue is that you have not disabled your browser cache. So your browser is using the cached html instead of downloading from S3.
To disable cache during development on Chrome for example, is to press F12 then go to Network tab and check Disable cache.
Do not close the window until you are happy with caches. If you do not want to keep the window open, alternatives are to use plugins or to modify your registry which are not really suggested.
Finally if you plan to use Cloudfront in the future, whenever you make an update to S3 and you will want to invalid Cloudfront caches before they automatically expire.

Chrome extension - using the filesystem API

The filesystem API cannot be used by unpacked extensions, which is awfully great for development.
But then the real surprise came when I realized I can't use it also with my extension packed, because Chrome tells me it cannot find it in the store and is thus greyed out.
Is there any way to actually develop with the filesystem API then?
My goal, in case this is the wrong direction in the first place, is to write some text to a file when some events in the browser happen. The file should be rewritten, rather than creating a new file, which is why I can't use the downloads API.
Is there any way out of this conundrum?
For anyone stumbling on the same issue - a decent solution is to use the chrome.downloads API to download the file in overwrite and incognito mode.
Overwrite will stop the automatic indices added to downloaded file names, and incognito makes the download invisible in the browser except for incognito windows.
The main shortcoming is that it is of course constrained to the user's downloads folder.

Is it possible to backup all the files under chrome/developer tools/sources?

I loaded a site and checking developer tools I can see a lot of folders and files under the Sources section, aunder a folder called top.
Is there a way or extension to help me copy all those folders and files to my hard drive?
Even if it's a third party tool would help, at the moment I cannot think on anything else other than manually copying everything, which would take quite a while!
Thank you.
There's nothing built into DevTools, but you may be able to run a snippet that downloads all the page's resources. I'm not sure what that code would look like. The basic idea would be to open the page, and then run the snippet on the page, with the code somehow iterating through and downloading every requested resource.
Could also be worth looking into Chrome Extensions that handle this. They have access to the Chrome Debugging Protocol which may give them deeper access to the page's resources.
I know this is an old question but this is currently possible by going into the Network tab and right clicking any request and clicking "Download All as HAR"

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/

HTML5 Application Cache manifest file location on hard drive

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.