Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I disable FF3 back button cache?

I found out that when pressing back button it gets previous page from browser cache even if I send following headers:

Test1.aspx

Server              ASP.NET Development Server/9.0.0.0
Date         Wed, 24 Mar 2010 17:49:40 GMT
X-AspNet-Version 2.0.50727
Location         Test2.aspx
Cache-Control no-cache, no-store
Pragma         no-cache
Expires         -1
Content-Type text/html; charset=utf-8
Content-Length 189
Connection         Close
like image 834
Sergej Andrejev Avatar asked Mar 24 '10 17:03

Sergej Andrejev


3 Answers

expires should be a date+timestamp and cache-control"s "must-revalidata" & "max-age" might help as well?

Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
like image 137
futtta Avatar answered Oct 12 '22 12:10

futtta


Cache-control and such things only tell browser NOT to save in cache the downloaded stuff (js, css, images, etc.). It does not relate with the History of visited pages.

You shouldn't try to modify browser's data. Instead, you'd handle events and stop the ones you don't want to happen in your site.

like image 29
Alfabravo Avatar answered Oct 12 '22 14:10

Alfabravo


For me the following setting in the header worked:

Pragma: no-cache

Cache-Control: no-cache, no-store

Expires: 0

like image 33
Ajanta Avatar answered Oct 12 '22 12:10

Ajanta