HTTP header immediate expiration and Page_Load in asp.net

  • Thread starter Thread starter Timo
  • Start date Start date
T

Timo

I've set my aspx page to expire immediately using the management console,
HTTP headers tab. Considering this scenario:
a user visits the aspx page in question, then moves to another page, then
hits the Back button to return to the page in question. At that point,
shouldn't the Page_Load event fire for the page since it was set to expire
immediately?
Thanks
Timo
 
Timo said:
I've set my aspx page to expire immediately using the management
console, HTTP headers tab. Considering this scenario:
a user visits the aspx page in question, then moves to another page,
then hits the Back button to return to the page in question. At that
point, shouldn't the Page_Load event fire for the page since it was
set to expire immediately?

No. Back button behaviour is unfortunately browser-specific. Many
browsers even adopt their behaviour depending on what Cache-Control
header they receive, or whether the underlying connection is secure or
not.

In addition to Expires (which isn't really that useful anyway), try
Cache-Control: no-cache or Cache-Control: max-age=0.

Cheers,
 
Thanks, Joerg. Setting No-cache in code-behind has the desired effect, as
you suggested.
Timo
 
Back
Top