HTTP header immediate expiration and Page_Load in asp.net

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
 
J

Joerg Jooss

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,
 
T

Timo

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top