All data uri resources are coming as (from memory cache) under Size column in devtools. Even after i cleared browsing data of chrome and checked 'disable cache' , and run in private window also, its still coming as memory cache .
How to clear this memory cache and load fresh as first time.
Update: Some DevTools engineers checked it out. DevTools lists Data URIs as originating from memory cache, even on a brand new Chrome profile. So it's a bug.
Try these:
Clear Storage pane
Empty Cache and Hard Reload
Related
It's very important for the website I'm working on to be offline-functional. I'm using a Cache Manifest to store all the files on the application cache, so that takes care of that and all is good and well.
BUT, as I read and noticed myself, the browser first shows the cached version of the site before checking for an update online. Hitting refresh reloads the cache again, with the new cached files this time (or what it had time to update for the swift refreshers).
I'm aware of this fix : http://www.html5rocks.com/en/tutorials/appcache/beginner/, where the user is told an update is available and is asked to refresh the page. Not a bad method, but still sketchy for user experience.
Is there any other way to force the browser to show the most up to date files if online? Would cache busting all files manually AND using a cache manifest fix this problem, or will it conflict with the cache manifest and cause problem to the offline functionality?
I found something that works well for me:
The URL linking to the web page contains a parameter. If there is ever a change to the page or related files, the url is changed to something like this: http:/ /www.mywebsite.com/mypage.html?v=3 where v=3 is changed depending on updates.
This is a longer fix to implement (finding every page affected by a change & changing all their cache busting links), but the pages at least show what they're supposed to on the first load and the cache manifest still load the update for offline viewing.
Once we open a link in a new tab in Firefox, the data corresponding to that web page(static or dynamic) gets stored in Browser Cache. Then, when we switches at that tab again, it extracts data of that page from Cache(not requesting from the server of that site) and paints it at the frame buffer of the screen.
I want to know that how Firefox fetches this data in correct sequence?
What kind of mapping does the Firefox uses to extract the page data from its Cache?
Firefox (like any other browser) uses heuristics to decide when and what to cache. This is assuming no caching information is included in the resources. When no caching information is provided, Firefox might still decide to cache the files for certain period of time.
If you want to avoid Firefox to cache your resources altogether, you must include the following response header on your resources:
Cache-Control:no-cache, no-store
Now, the exact algorithm that Firefox uses to fetch from cache I don't think is public. Maybe somebody from Mozilla is able to answer this.
Is it possible that if user with a full browser cache comes to my website and some my resources required to be cached (via Cache-Control header), then browser will remove some old (but still valid, i.e. non-expired) items from the cache in order to make it possible to cache my resources?
If there is no outdated resources in user's cache, will the browser ignore my cache policy?
If the cache is full the browser has to find room for new content somewhere.
A sane approach to this would be to
1) first remove all expired contents.
2) second remove oldest (based on time since last visit) contents
But, to be honest with you I have never looked deep into this issue because I find it counter productive to rely on cached contents. Many browsers have a "delete all cache on exit" button. Or the users run programs like CCleaner to remove temporary files. Cache is basically considered temporary files.
I suppose you could try writing a server log analyzer that would determine whether specific resources are being reloaded at a time when companion resources are not being loaded. This would involve separating the header-only call that is used to determine "age" of the resource vs. the full download of the resource. Again mostly speculation since, I don't rely on cache being there AND I don't use cache as a tracking device.
is it some how possible to search firefox cache entries from an application which is online and doesn't ask user to install anything on his computer...does mozilla provide any api for this or some functions to do this.
Probably not the cache you want, maybe something more along the line of
HTML5 local storage or Offline Web Application, apart from that it would be difficult to know what is in the entire cache due to security constrains, but you can use the server response header to detect what item the browser think it has in cache (detect the response 304 in http server header, if you provide the proper headers ).
I'm not sure if the local cache is available online from any other computer, but you can type about:cache in the URL bar and it'll take you to a page that can identify things in both memory and disk.
Hope that helps.
Background
I'm building an app that links recent
web pages you've visited together.
To do this, I need to get the HTML
for recent URLs using Cocoa.
Right now, I'm using an invisible
WebView to do this.
As I understand it, if the URL isn't
in the cache for my app, this is
hitting web servers.
What I want
The chances are high that the URL I'm grabbing has already been cached by Safari as the page has already been visited.
I want my app to check Safari's cache for the URL first. If it's there, it should just use this data. If not, it should hit the web server and store the page in my app's cache.
I don't really want to have to parse the cache.db file from Safari using sqlite3 - I've no idea if this format will stay the same. I'm after something simpler and more high level.
What I've tried
I know that you can set up your own NSURLCache using the method initWithMemoryCapacity:diskCapacity:diskPath: but I don't want to try pointing this to the Safari cache in case it screws up Safari by writing to it.
Is there an easy, high level way of sharing the Safari cache?
UPDATE
Aha. I've just realised there may be a way to do this I've been missing.
I could make a new instance of NSURLCache with initWithMemoryCapacity:diskCapacity:diskPath:, point it at the Safari cache, then specify a cache policy of NSURLRequestReturnCacheDataDontLoad for the URL Request when loading the page.
When this fails, I could just try and load the page as normal. I'll try this out and update the question when I know more.
To be honest, you just can't do this.
Firstly, I'm pretty certain -[NSURLCache initWithMemoryCapacity:diskCapacity:diskPath:] won't work as you expect. It will instead blow away the old cache file to create its own; potentially highly upsetting Safari.
Secondly NSURLCache is a composite cache. That is, it caches data first in memory, and then moves it out to disk at some point. So even if you could properly access Safari's cache file (which you can't) you'd only be able to access the older cached data; not the most recent.