Questions tagged [browser-cache]

Browser caches are an instance of the optimization mechanism known as a cache.

Browser caches are an instance of the optimization mechanism known as a cache.

The browser cache is nothing more than a place on your hard disk where the browser keeps things that it downloaded in case they're needed again.

For example, the first time you visit a web page, the browser will download some files like the logo image or icon images, so that it can be shown.

Since it's faster to get something to display from your hard disk than it is to get it from the internet, every time thereafter when you visit the same web page or any page on that domain, the browser will be searching for the required images and other files on its cache folder. Only if not found it goes to the internet to download them.

2884 questions
36
votes
2 answers

How to enable ETag headers on Nginx for static files?

I'm using Nginx as a webserver and want to implement a browser caching method so that the users keep copies of static, unchanged files locally and download only changed files. One of the propositions was to use the file's timestamp to figure out the…
HanouaJ
  • 361
  • 1
  • 3
  • 4
35
votes
5 answers

How to clear a Service Worker cache in Firefox?

In Chrome it is possible to clear the Service Worker cache from the Dev Tools. How can we achieve that in Firefox? I've tried so far: to unregister the service in about:serviceworkers to empty the cache under about:preferences#privacy to reload…
Supersharp
  • 29,002
  • 9
  • 92
  • 134
35
votes
6 answers

How to tell if an XMLHTTPRequest hit the browser cache

If it possible to tell (within javascript execution) if a GET XMLHTTPRequest hit the browser cache instead of getting its response from the server?
rjkaplan
  • 3,138
  • 5
  • 27
  • 33
33
votes
13 answers

Firefox addon to remove cache and cookies of one domain?

I use Firefox to develop a web site and at the same time to browse the web, read my gmail, etc. The problem is every now and then I need to delete the cache and or remove the cookies of the web app, but I want to stayed logged in in the other web…
flybywire
  • 261,858
  • 191
  • 397
  • 503
32
votes
12 answers

How can I read Chrome Cache files?

A forum I frequent was down today, and upon restoration, I discovered that the last two days of forum posting had been rolled back completely. Needless to say, I'd like to get back what data I can from the forum loss, and I am hoping I have at…
Raven Dreamer
  • 6,940
  • 13
  • 64
  • 101
32
votes
2 answers

How do I leverage browser caching of .woff fonts?

In PageSpeed Insights I keep seeing the message to leverage browser caching of a particular iconset/font I'm using: iconFont.woff (2 days) I've set my .htaccess as so: ## EXPIRES CACHING ## ExpiresActive On ExpiresByType…
Mikedefieslife
  • 421
  • 1
  • 6
  • 14
31
votes
4 answers

Clear browser cache in Angular

I have a problem with an Angular application that I update very often. I would like to avoid the browser cache and I am trying several alternatives but none of them work. The first thing is that I have very difficult to test if the solution works…
Ulises 2010
  • 478
  • 1
  • 6
  • 16
30
votes
3 answers

Avoid caching of the http responses

What is the definitive solution for avoid any kind of caching of http data? We can modify the client as well as the server - so I think we can split the task between client and the server. Client can append to each request a random parameter…
STeN
  • 6,262
  • 22
  • 80
  • 125
30
votes
5 answers

What heuristics do browsers use to cache resources not explicitly set to be cachable?

13.2.2 Heuristic Expiration Since origin servers do not always provide explicit expiration times, HTTP caches typically assign heuristic expiration times, employing algorithms that use other header values (such as the Last-Modified time) to…
Rick Viscomi
  • 8,180
  • 4
  • 35
  • 50
30
votes
3 answers

After logout, if I push back button I can see the last page which requires login

I have devise configured in my web application. I have problem with the following workflow: For accessing admin panel I need to login. After that I navigate to admin panel of my web app normally. When I click logout it redirects me to the root page…
JohnDel
  • 2,092
  • 8
  • 35
  • 64
29
votes
3 answers

Use ServiceWorker cache only when offline

I'm trying to integrate service workers into my app, but I've found the service worker tries to retrieve cached content even when online, but I want it to prefer the network in these situations. How can I do this? Below is the code I have now, but I…
Ruben Martinez Jr.
  • 3,199
  • 5
  • 42
  • 76
27
votes
1 answer

How to delete ios simulator safari cache

I'm trying to test a website on the iphone simulator, I made some javascript changes and my javascript files are being loaded from cache. I see the old version files with safari web inspector, resources tab (on simulator window), also the network…
Dan
  • 1,112
  • 9
  • 15
26
votes
5 answers

How to cache fetched data in react without redux

I know, using Redux I have common store and when I change my location, for example I went from /videos page, but I still have fetched videos in my videos reducer. So if I then decide to go back to my videos page I show user already loaded videos…
Den Gas
  • 739
  • 2
  • 7
  • 11
26
votes
5 answers

Is it better to use Cache or CDN?

I was studying about browser performance when loading static files and this doubt has come. Some people say that use CDN static files (i.e. Google Code, jQuery latest, AJAX CDN,...) is better for performance, because it requests from another domain…
Gustavo Gondim
  • 1,635
  • 2
  • 18
  • 39
26
votes
5 answers

Force a reload of page in Chrome using Javascript [no cache]

I need to reload a page using JavaScript and ensure that it does not pull from the browser cache but instead reloads the page from the server. [As elements of the page will have changed in the interim] On IE and FF I found that the following code…
graney
  • 1,365
  • 2
  • 13
  • 20