34 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 ...
user avatar
  • 4,344
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 ...
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 ...
user avatar
6 votes
Accepted

Google Pagespeed tells me to leverage browser caching when caching is already enabled

24 hours is too little to suffice as cache control :) In theory, images never change without their name also changing, so you can set that easily to a year (or a month if you feel more comfortable ...
user avatar
  • 6,736
6 votes
Accepted

How to set browser cache to expire after one day?

It might be as simple as missing one keyword that is causing your issue. ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 day" ...
user avatar
  • 85.8k
4 votes
Accepted

What effect does turning off caching in all browsers have on SEO?

It slows down your page loading speed which can potentially be a negative ranking signal.
user avatar
  • 85.8k
4 votes

Google Pagespeed tells me to leverage browser caching when caching is already enabled

I see that the previous answer says that 24 hours is not enough. But looking into Google document: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#...
user avatar
  • 141
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 ...
user avatar
4 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 ...
user avatar
  • 156
3 votes

What effect does turning off caching in all browsers have on SEO?

Turning off browser caching can be important for: Security (so that pages can't be found in browser cache) Accurate site stats (so that you can count each visit to a page) I've worked with big sites ...
user avatar
3 votes

Cache control header specified in .htaccess is not working for static files

I was serving my static files using Django while my media files using Apache. Serving my static files through Apache solved this issue.
user avatar
  • 235
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 ...
user avatar
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 ...
user avatar
  • 1,794
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 ...
user avatar
  • 585
2 votes
Accepted

Caching of JS and CSS files – Apache mod_headers doesn’t take effect

<FilesMatch "^(.*)\-\-.+\.(js|css)$"> FilesMatch takes a filename and matches against the file system, not the URL. The underlying file is still called "myscript.js", so this pattern should be ...
user avatar
  • 41.3k
2 votes

How to make CloudFlare Cache all pages

That's not correct. If you would like to extend CloudFlare's CDN to cache more than static content by default, you can use Page Rules to extend the caching capabilities to cache more content. Page ...
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 ...
user avatar
  • 1,316
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 ...
user avatar
2 votes
Accepted

When do browsers clear cache and how can I make more use of 304 responses?

When an HTML page or content (CSS, JavaScript, images, fonts... etc.) is expired past it's cache control header time, how long do browsers keep the content around to make use of 304 responses? While ...
user avatar
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 ...
user avatar
  • 4,344
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 ...
user avatar
  • 41.3k
2 votes

Caching a changing site

When new content is launched, it may not be absolutely critical that users see it right away. In that case you could relax your cache controls and allow your content to be cached for an hour or two ...
user avatar
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 ...
user avatar
  • 4,344
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 ...
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 ...
user avatar
  • 2,856
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) ...
user avatar
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: ...
user avatar
  • 41.3k
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 ...
user avatar
  • 2,243
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.
user avatar
  • 5,487
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 ...
user avatar

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