php - Website with optimal cache control -
my goal
let browsers cache whole website, download static content when have changed 1 or more files.
my situation
after research have found way this. add far future expires header
htaccess file , add querystring files using filemtime()
function.
the problem
when click on address bar , type in website address in firefox, firebug displays 38.3 kb (36.4 kb cache)
when press f5 in firefox, firebug displays:241.1 kb (10.9 kb cache)
now have tried same google , sending http header 304 back. have read lot etag , last modified header, have heard lot of people saying not reliable.
my question
best solution if send http header 304 static content if user presses on f5, google?
i asking question because visiting website , using f5 see if there new information available. not reload images etcetera.
update
seems firefox controlling way cache used , use cache when user presses f5.
the purpose of reload reload page. there no server-side header magic if browser witten ignore caches when user asks it.
the solution google check if crawler sent if-modified-since header with:
if ($_server["http_if_modified_since"]) { header("http/1.0 304 not modified"); exit(); }
this trick work browsers, not in forced reload modes, firefox's shift+reload.
Comments
Post a Comment