Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: overkill anti-caching CGI headers

by davebaker (Monk)
on Jun 18, 2009 at 15:53 UTC ( #772771=note: print w/ replies, xml ) Need Help??


in reply to overkill anti-caching CGI headers

This is a great comment.

I spent quite a little while trying to determine why I was unable to get CGI::Application::Plugin::Authentication to work correctly with my CGI app; I'd fill in the login form, click the button, but no joy. Click again. Then again. Then, on the fourth try, the login would go through. But sometimes it took 5 clicks. Sometimes only 3. Drove me batty, until I realized that the web server was cacheing the result of cgi scripts... set at 10 seconds. Firefox wouldn't submit the login form's data to the script until 10 seconds had passed since the time the login form appeared in the browser.

I control the Apache config file on my server, and fixing the problem on the server side was easier for me. It was a matter of removing this line:

ExpiresDefault "access plus 10 seconds""


Comment on Re: overkill anti-caching CGI headers
Re^2: overkill anti-caching CGI headers
by oalders (Initiate) on Aug 28, 2009 at 17:09 UTC

    This worked really well for me too. Am working on an app where AJAX calls were being cached by MSIE 7. I pasted the code into the cgiapp_prerun and instantly all was well.

    My only change was to use DateTime rather than POSIX

    -Last_Modified => DateTime->now->strftime('%a, %d %b %Y %H:%M:%S GMT')

    This saved me a bunch time -- thanks!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://772771]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (13)
As of 2014-04-18 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls