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
24
votes
8 answers

How to clear browser cache when re-uploading image with same filename, in php?

I have a listing of items, that also contains an image thumbnail. Sometimes I need to change the thumbnail image, but keep the filename the same. Is there a way to force the browser to download the newly uploaded image, instead of grabbing one from…
user15063
23
votes
2 answers

How to clear browser cache on browser back button click in MVC4?

I know this is a popular question in stackoverflow. I have gone through every same question and I am unable to find the right answer for me. This is my log out controller Action Result [Authorize] public ActionResult LogOut(User…
Sandy
  • 2,429
  • 7
  • 33
  • 63
22
votes
1 answer

Browser caching - Why does IE9 always show http 304 when actually it did not hit the network?

I am trying to set up caching correctly and have set Expires headers to 365 days in the future which is working correctly but not showing correctly in IE9. Does anyone know why? When you visit any website in IE9 (eg www.google.com) then click Enter…
mike nelson
  • 21,218
  • 14
  • 66
  • 75
22
votes
4 answers

How to disable cache in wordpress

I am creating a website, but I needed to do refresh several time to see the changes I made in website. Is there any option that I can use to disable cache in WordPress?
user7444728
22
votes
3 answers

How to handle caching of JavaScript files imported as ES6 module

Old situation Previously, I used the following method to force the browser to reload my JavaScript file if there was a new version available. My HTML is…
sebas
  • 1,283
  • 1
  • 12
  • 16
22
votes
1 answer

What is the JavaScript equivalent of "Clear Site Data" in Chrome Dev Tools?

I am looking for a way to trigger the same behavior as "Clear site data" in Chrome Dev tools or as close to the same behavior as possible. I know there are some things that are not possible i.e. clearing browser cache, and this doesn't need to be…
aug
  • 11,138
  • 9
  • 72
  • 93
22
votes
1 answer

Is it possible to cache an entire HTML5 video using the Service Worker API for offline use?

I have an offline app that caches all static resources. Currently, only the first 15 seconds of video assets are cached. Below shows basic implementations of the install and fetch event listeners. Service Worker: self.addEventListener('install',…
Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158
22
votes
5 answers

Website html doesnt update for users because of cache

I am making a website and am running into an issue with website cache for my users. I develop my website and have set chrome developer tools to disable cache for my website for development. The issue is when i release a new change to prod all my…
Tomer Shemesh
  • 10,278
  • 4
  • 21
  • 44
22
votes
3 answers

"Cache-Control: max-age=0, no-cache" but browser bypasses server query (and hits cache)?

I'm using Chrome 40 (so something nice and modern). Cache-Control: max-age=0, no-cache is set on all pages - so I expect the browser to only use something from its cache if it has first checked with the server and gotten a 304 Not Modified…
George Hawkins
  • 37,044
  • 7
  • 30
  • 43
22
votes
2 answers

Browser caching issues in flask

I have built a website using flask (www.csppdb.com). Sometimes when I log in as one user, log out, then login as another user I still see pages from the first user I logged in as. This problem is immediately fixed when the page is refreshed. I think…
The Internet
  • 7,959
  • 10
  • 54
  • 89
21
votes
9 answers

Clear cache before running some Selenium WebDriver tests using Java

I am working on Selenium WebDriver automation in java programming language. In my test suite that initiates the browser window once and perform all the tests. I want to clear the browser cache before running some tests without restarting the…
Uziii
  • 763
  • 7
  • 11
  • 26
21
votes
2 answers

clear cache of browser by command line

I am working in media domain. I need to check every change in all leading browsers i.e. IE, Firefox, Chrome, Safari and Opera. To clear cache, every time i need to use Ctrl + Shift + del. Is there any another way to clear the cache of every web…
Pradip
  • 1,317
  • 4
  • 21
  • 36
21
votes
2 answers

IIS 7.5 and images not being cached

I cannot get the image files to cache. I have tried everything that I have found on this site and others and still cannot get them to cache. Web config setting that I have tried
user1167466
  • 333
  • 1
  • 4
  • 14
20
votes
4 answers

Is there any way to cache all files of defined folder/path in service worker?

In service worker, I can define array of resource those are being cached during service worker get started mentioned below: self.addEventListener('install', event => { event.waitUntil(caches.open('static-${version}') .then(cache =>…
Mohd Yasin
  • 427
  • 1
  • 5
  • 13
19
votes
2 answers

Proper way to handle 304 not modified in jQuery ajax

As of jQuery 1.5, the ajax methods now correctly handle 304 Not Modified responses by calling the success() handler, as per the W3C spec for XMLHTTPRequest. This allows your application to treat the request as being successful, even if the server…
Scott
  • 1,518
  • 1
  • 15
  • 23