Questions tagged [cache]

A cache is a local copy of a file that exists elsewhere. Caching can take place in the browser, on a dedicated machine on a network, or at an ISP.

296 questions
271
votes
42 answers

Recovering a lost website with no backup?

Unfortunately, our hosting provider experienced 100% data loss, so I've lost all content for two hosted blog websites: http://blog.stackoverflow.com http://www.codinghorror.com (Yes, yes, I absolutely should have done complete offsite backups.…
Jeff Atwood
  • 14,002
  • 18
  • 66
  • 79
40
votes
4 answers

How do I set expiration headers for CSS, JS, and Images?

I have recently analysed my website with pagespeed addon on firebug. It suggested me to set expiration on CSS, JS and image files. I am wondering how do i do this?
KoolKabin
  • 1,658
  • 4
  • 19
  • 26
38
votes
1 answer

What happens if you don't set cache-control header?

What happens if you don't set the cache-control header? Does HTTP specify a default behaviour that clients should follow or is it up to the clients to decide? In Chrome, I have seen some Javascript requests that have no cache-control headers showing…
Nishant
  • 503
  • 1
  • 4
  • 8
33
votes
6 answers

Headers to prevent 304/If-modified-since/HEAD requests

What headers should I be sending to outright stop all requests to the server after the content has been cached? We have a very high latency server (Sigh, VMWare) so even sending a HEAD request to the server takes +40ms. Currently these are the…
Blank
  • 660
  • 1
  • 6
  • 10
21
votes
5 answers

Why don't browsers have jQuery installed?

I'm using jQuery on several of my websites and although I use a CDN to serve it, it just doesn't make sense for visitor to download jQuery each time. jQuery must be the world's most widely used JavaScript framework - wouldn't it make more sense if…
user1914292
  • 361
  • 2
  • 4
21
votes
1 answer

How do I prevent Google from serving a cached version of my site?

From what I understand I can tell Google to remove pages from their archive if I add the header: But won't this also remove the page from search results? I only want the "Cached" link removed.
artlung
  • 8,688
  • 5
  • 45
  • 63
14
votes
2 answers

Control over the Internet Archive besides just "Disallow /"?

Are there any mechanisms to control what the Internet Archive archives on a site? I know to disallow all pages I could add: User-agent: ia_archiver Disallow: / Can I tell the bot that I want them to crawl my site once a month, or once a year? I…
artlung
  • 8,688
  • 5
  • 45
  • 63
13
votes
2 answers

URL with query disables caching?

Does having a query string attached to a URL cause browsers to never cache it? For instance, my site does something like this: /radar-picture.png?v=sep2013 And it would appear that FireFox never caches that picture; it is downloaded on every…
Mr. Smith
  • 255
  • 1
  • 2
  • 8
13
votes
4 answers

"404. That’s an error." when viewing from Google cache

My site is getting 404. That’s an error. message when I click on cached from Google search results. This is the error message from Google: That’s an error. The requested URL /search?q=cache:8kxLAgFrhZQJ:www.mysite.com.....&cd=8&hl=en&ct=clnk&gl=uk…
user2357716
  • 131
  • 1
  • 1
  • 3
11
votes
2 answers

Cloudflare: Cache static HTML when URL has Query String

Quick CloudFlare 'new user' question for you: BACKGROUND: The HTML pages served up by my origin server never change. All dynamic content is download via JavaScript after the page is loaded in the user's browser. The dynamic content derived by the…
9
votes
1 answer

Why is spam added to the Bing cache of my landing page?

Please search on Bing "url:testrails.org" and open the cached page. Bing shows random other pages below the content of my own landing page. This is so weird! This is what I found out so far: I have a second domain that I also manage on the Bing…
analog-nico
  • 213
  • 1
  • 5
9
votes
3 answers

Why don't browsers respect cache headers for initial page request?

I'm scratching my head a bit on this. A Drupal site I run is setting appropriate cache headers that should indicate that the page can be cached for 15 minutes. However, every time I hit the page it always sends a GET request instead of loading the…
Brian
  • 204
  • 1
  • 6
9
votes
3 answers

Is it worth it to change my entire user images file structure to take advantage of simple browser caching?

On one of my mobile sites, I simply store my user's profile images as '1.jpg' in their user folder, and incrementally go from there for any extra pics they upload. This means that whenever they change their profile pic, for example, the file name…
ProgrammerGirl
  • 388
  • 3
  • 7
7
votes
1 answer

The Node Express server is returning "304 Not Modified" responses, but only after querying the database

I'm just diving into web developent, my current passion is Express (Node.js). I've noticed then i often recieve HTTP/1.1 304 Not Modified either for static content and (!) for my json API requests (when data is still the same, so this is actually…
7
votes
1 answer

Why doesn't FireFox cache my JavaScript file?

I've been trying to figure out why Firefox does not cache my JavaScript file. I don't have this issue with Chrome or IE. Here is what my server's Response Header looks…
Roman Mik
  • 213
  • 2
  • 5
1
2 3
19 20