Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should my expires, cache-control, and pragma HTTP request header fields be set to?

I have a website in which I update the content approximately once monthly. When I check the HTTP request header fields, I get the following output:

Expires: Thu, 19 Nov 1981 08:52:00 GMT  
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0   
Pragma: no-cache

My question is, given the frequency at which I update content, I am thinking about manually setting these fields to allow cache of the site. I am using the php header(); command to do so.

Therefore, my question is: what should my expires, cache-control, and pragma HTTP request header fields be set to? Also, should I be setting any other fields in addition to those?

like image 498
TroubledGuym Avatar asked Nov 14 '22 07:11

TroubledGuym


1 Answers

You could look into using ETAGs - http://en.wikipedia.org/wiki/HTTP_ETag

like image 170
hafichuk Avatar answered Nov 17 '22 05:11

hafichuk