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.

2673 questions
1660
votes
33 answers

Disabling Chrome cache for website development

I am modifying a site's appearance (CSS modifications) but can't see the result on Chrome because of annoying persistent cache. I tried Shift+refresh but it doesn't work. How can I disable the cache temporarily or refresh the page in some way that I…
tomermes
  • 21,672
  • 15
  • 39
  • 61
665
votes
8 answers

What's the difference between Cache-Control: max-age=0 and no-cache?

The header Cache-Control: max-age=0 implies that the content is considered stale (and must be re-fetched) immediately, which is in effect the same thing as Cache-Control: no-cache.
rubyruy
  • 7,101
  • 3
  • 16
  • 15
366
votes
4 answers

What's the difference between "Normal Reload", "Hard Reload", and "Empty Cache and Hard Reload" in Chrome?

I recently discovered this new feature in Chrome: I can figure out the difference between option 1 and option 3, and that option 2 is probably something in between, but I can't find any more precise information anywhere. Anybody know the precise…
Samuel Rossille
  • 16,848
  • 18
  • 55
  • 85
276
votes
21 answers

Prevent browser caching of AJAX call result

It looks like if I load dynamic content using $.get(), the result is cached in browser. Adding some random string in QueryString seems to solve this issue (I use new Date().toString()), but this feels like a hack. Is there any other way to achieve…
Salamander2007
  • 5,974
  • 8
  • 30
  • 26
246
votes
8 answers

How to set HTTP headers (for cache-control)?

How to enable browser caching for my site? Do I just put cache-control:public somewhere up in my header like this?
andrew
  • 4,758
  • 9
  • 40
  • 56
212
votes
13 answers

AngularJS disable partial caching on dev machine

I have problem with caching partials in AngularJS. In my HTML page I have:
where my partials are loaded. When I change HTML code in my partial, browser still load old data. Is there any workaround?
Mennion
  • 2,823
  • 3
  • 18
  • 34
200
votes
8 answers

Disable browser cache for entire ASP.NET website

I am looking for a method to disable the browser cache for an entire ASP.NET MVC Website I found the following method: Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); Response.Cache.SetNoStore(); And also a meta tag method (it…
Palani
  • 8,532
  • 10
  • 51
  • 62
192
votes
6 answers

Do browsers parse javascript on every page load?

Do browsers (IE and Firefox) parse linked javascript files every time the page refreshes? They can cache the files, so I'm guessing they won't try to download them each time, but as each page is essentially separate, I expect them to tear down any…
Steve Jones
156
votes
4 answers

What is Cache-Control: private?

When I visit chesseng.herokuapp.com I get a response header that looks like Cache-Control:private Connection:keep-alive Content-Encoding:gzip Content-Type:text/css Date:Tue, 16 Oct 2012 06:37:53 GMT Last-Modified:Tue, 16 Oct 2012 03:13:38…
user782220
  • 9,199
  • 16
  • 64
  • 127
143
votes
8 answers

What does appending "?v=1" to CSS and JavaScript URLs in link and script tags do?

I have been looking at a HTML 5 boilerplate template (from http://html5boilerplate.com/) and noticed the use of "?v=1" in URLs when referring to CSS and JavaScript files. What does appending "?v=1" to CSS and JavaScript URLs in link and script tags…
maxyfc
  • 10,507
  • 7
  • 34
  • 45
134
votes
6 answers

How to prevent Browser cache for php site

I have a php site running in cloud server.When ever i add new files css, js or images the browser is loading the same old js, css and image files stored in cache. My site has a doctype and meta tag as below
ArrayOutOfBound
  • 2,424
  • 4
  • 18
  • 24
131
votes
18 answers

How to force a web browser NOT to cache images

Background I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill the fields (date, place, title, description, links,…
Philibert Perusse
  • 3,656
  • 5
  • 22
  • 25
123
votes
5 answers

Make page to tell browser not to cache/preserve input values

Most browsers cache form input values. So when the user refreshes a page, the inputs have the same values. Here's my problem. When a user clicks Save, the server validates POSTed data (e.g. checked products), and if not valid, sends it back to the…
queen3
  • 14,883
  • 8
  • 54
  • 114
121
votes
6 answers

How to prevent Browser cache on Angular 2 site?

We're currently working on a new project with regular updates that's being used daily by one of our clients. This project is being developed using angular 2 and we're facing cache issues, that is our clients are not seeing the latest changes on…
Rikku121
  • 2,171
  • 2
  • 19
  • 34
108
votes
11 answers

How to force reloading a page when using browser back button?

I need to somehow detect that the user has pressed a browsers back button and reload the page with refresh (reloading the content and CSS) using jquery. How to detect such action via jquery? Because right now some elements are not reloaded if I use…
John Doeherskij
  • 1,479
  • 3
  • 11
  • 17
1
2 3
99 100