Skip to main content
41 votes
Accepted

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

If there is no Cache-Control header and no Expires header, but there is a Last-Modified header (which most web servers send by default for static assets), most browsers will use heuristic freshness to ...
Tim Fountain's user avatar
  • 4,464
9 votes
Accepted

Prevent browser from caching text file

You have two approaches to this problem. The clean way is to set the headers returned for GET data.txt preventing the browser (or proxy) from storing the response in cache. Using apache, this can ...
Antony Gibbs's user avatar
6 votes

Why is Chrome caching my login page?

no-cache is not as strong as no-store. Chrome's documentation indicates that no-cache indicates a re-usable document, while no-store indicates that it should not be re-used. Based on this ...
Stephen Ostermiller's user avatar
5 votes
Accepted

Cache-Control for ads.txt, robots.txt and sitemap.xml files that are generated dynamically

I understand you want to use Cache-Control private/no-store because you don't want the CDN to cache an outdated version of those files. However, not caching these files (i.e. all requests go back to ...
iangetz's user avatar
  • 166
4 votes
Accepted

How to limit Google crawling certain URL patterns?

It is not a good idea to let Googlebot crawl URLs that can be constructed with combinations of parameters. When you allow your categories to be filtered, my advice is to only allow Googlebot to ...
Stephen Ostermiller's user avatar
3 votes
Accepted

Do browsers send different HTTP headers on page reload so that server side caches can be flushed?

Browsers do send additional headers, but behavior different. This info in link a bit outdated: stackoverflow question Looks like Cache-control:no-cache is the best solution, to check for Ctrl+F5, but ...
LeonidMew's user avatar
  • 615
3 votes

Do browsers send different HTTP headers on page reload so that server side caches can be flushed?

No. The browser will send the same information on a refresh as if the user had just come to that page, with the same referrer information. Hence the problem of double-POSTing if someone refreshes the ...
GeoffAtkins's user avatar
  • 2,277
3 votes

Why does Pingdom suggest that I add a "Vary: Accept-Encoding" header?

What is it? The Vary HTTP response header tells user agents (clients) that the server's response can vary if the client changes any of the mentioned request headers. Vary: Accept-Encoding This means ...
Oskar Skog's user avatar
2 votes

Prevent browser from caching text file

The right way would be to change the Apache configuration (via htaccess or conf file) with the expire headers with very low caching time. Double check if you have access to .htaccess file if not ...
Aakash's user avatar
  • 1,316
2 votes
Accepted

Browser Cache Control | Individual Resources

You seem to be asking two different questions here. The best way to handle caching of static assets is to set the max-age/expires date far in the future, but have the URL to the asset automatically ...
Tim Fountain's user avatar
  • 4,464
2 votes
Accepted

What headers do I need to set to allow my content to be cached without any sort of revalidation for a set amount of time?

The Expires header is the simplest. If you're using Apache you can set this by mime type using mod_expires. In your .htaccess: <IfModule mod_expires.c> ExpiresActive On ExpiresByType ...
Tim Fountain's user avatar
  • 4,464
2 votes
Accepted

Setting cache-control on files with no extension

By "type" I assume you mean mime-type, in which case you should look at mod_expires and the ExpiresByType directive - this is undoubtedly the easiest/modern way to set the appropriate Expires and ...
MrWhite's user avatar
  • 42.9k
2 votes

How to over ride a users cache when new assets / content are available

I agree with Stephen that "cache busting" is the way to go. Is there anything else that could be done server side such as setting a new apache rule You can use the apache rewrite module (make ...
Mike -- No longer here's user avatar
2 votes

How to manually add expire header for google fonts css files?

You cannot change the headers for requests you're not responding to. In this case, the browser will make a request to Google asking for fonts. The browser will receive a response from Google(not you) ...
mikaelwallgren's user avatar
2 votes

Does the below-mentioned server header impact google indexing?

Nothing you do on your end can really affect the crawl rate Google uses. You have the ability to slow down crawls through webmaster tools but there is no way to speed it up through webmaster tools or ...
Chris Rutherfurd's user avatar
2 votes

How to limit Google crawling certain URL patterns?

Have you looked at limiting Google's bot threshold? Per Google, If Google is making too many requests per second to your site and slowing down your server, you can limit how fast Google ...
Trebor's user avatar
  • 3,270
2 votes
Accepted

What's the difference between access and access plus in ExpiresByType directive?

These two directives are the same. The plus keyword is entirely optional. It is just syntactic sugar, to make it (arguably) more "readable". As stated in the Apache docs for mod_expires: ...
MrWhite's user avatar
  • 42.9k
2 votes
Accepted

How does hash in file name affect google image search ranking?

On a long-term basis, I don't think there will be any differences in SEO impact (image-SEO) between the above two methods. But, there could be short-term SEO impacts when changing filenames during ...
Kannan's user avatar
  • 2,343
1 vote
Accepted

What types of files does ExpiresDefault include?

But, what are the file types that ExpiresDefault will work on ? As you've stated, "the rest". Any responses that are not covered by the mime-types stated in the preceding ExpiresByType ...
MrWhite's user avatar
  • 42.9k
1 vote

How ExpiresByType and Header set Cache-Control works together?

ExpiresByType image/jpg "access 2 years" First... to clarify, this should probably be image/jpeg, not image/jpg. image/jpeg is the official mime-type for JPEG files. Check the Content-Type ...
MrWhite's user avatar
  • 42.9k
1 vote

On startup, Chrome ignores "cache-control: no-cache" and does not revalidate when configured to "Continue where you left off"

Chrome is really annoying when it comes to caching. I normally open an incognito tab, but I would still test if it is the latest version of your site if it means losing data.
gellowg's user avatar
  • 31
1 vote

How to cache Images & JS files on static HTML page

To leverage Browser Caching on Windows Host, assuming it's IIS, you have to add this snippet in the web.config file in the document root of your website: <system.webServer> <staticContent>...
gael's user avatar
  • 1,050
1 vote

Google Pagespeed test, image slowing speed

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or ...
Mnea's user avatar
  • 335
1 vote
Accepted

Cannot find where my site is being cached!

Finally found it! Figured I'd post my answer here in case someone stumbles upon this thread later.. So in my case it happened to be opcache! I just added my webroot to the blacklist at /etc/php.d/...
ndom91's user avatar
  • 121
1 vote
Accepted

Accelerated mobile page(AMP) and password protected admin area, Can I combine both in single page?

Admin UI pages, and pages what must not be stored in cache just don't have ⚡ or amp attribute in html tag, while still use amp javascripts and markup. Anyway, that pages may be password protected, and ...
LeonidMew's user avatar
  • 615
1 vote

Why does Pingdom suggest that I add a "Vary: Accept-Encoding" header?

One main reason to use "Vary: Accept-encoding" is as Oskar mentioned, to allow content to be delivered based on what the browser is capable of. "Accept-encoding" is an especially important parameter ...
Mike -- No longer here's user avatar
1 vote

How to enable browsing cache for my website?

When you connect to your FTP server, create .htaccess file and paste one of these codes in it: Adding Expire Headers ExpiresActive On ExpiresDefault A0 # 1 YEAR - doesn't change often <...
Jakub Kliský's user avatar
1 vote
Accepted

How to enable browsing cache for my website?

Easiest way would be to use a CDN like Cloudflare. They will automatically cache your static resources, and serve them over HTTP2 as well if you want. This should have an immediate effect on the ...
Tom Gullen's user avatar
  • 2,390
1 vote

Can browser caching be controlled by HTTP headers alone without using hash names for asset files?

You really don't need to use hashname in your assets(js or css), browser will know about the file modification from your ETAG. Might this answer will also help you.
Goyllo's user avatar
  • 5,507
1 vote

Can browser caching be controlled by HTTP headers alone without using hash names for asset files?

Yes, you can tell the browser not to cache anything, but then your site will be slower because visitors have to re-download the assets on every page load. The files you refer to are auto-generated ...
DisgruntledGoat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible