anuvc
asked on
perl clear cache
hi all
I am working on a project that generates financial reports for a set of companies using perl and apache on linux. The problem that i'm facing is that the pages are cached and therefor if i call a report for clent A,the details of client B are displayed.
I have tried putting the foll:
#!/usr/bin/perl -w
my $month = param('month');
use lib '/var/www/cgi-bin';
use modules::module;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
print header;
print start_html('Client A Report');
print"<meta http-equiv=expires content=0> ";
print"<META HTTP-EQUIV=pragma CONTENT=no-cache> ";
print"<body bgcolor=#E6E7E6>";
print "<table border=1 cellpadding=1 cellspacing=1 bgcolor=white>";
:
:
But this is not helping me. If I hit ctrl-F5 the correct data is dislayed,but obviously i cant ask my clent to do the same.
plz help!!!!
Anuvc
I am working on a project that generates financial reports for a set of companies using perl and apache on linux. The problem that i'm facing is that the pages are cached and therefor if i call a report for clent A,the details of client B are displayed.
I have tried putting the foll:
#!/usr/bin/perl -w
my $month = param('month');
use lib '/var/www/cgi-bin';
use modules::module;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
print header;
print start_html('Client A Report');
print"<meta http-equiv=expires content=0> ";
print"<META HTTP-EQUIV=pragma CONTENT=no-cache> ";
print"<body bgcolor=#E6E7E6>";
print "<table border=1 cellpadding=1 cellspacing=1 bgcolor=white>";
:
:
But this is not helping me. If I hit ctrl-F5 the correct data is dislayed,but obviously i cant ask my clent to do the same.
plz help!!!!
Anuvc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I do not agree with Sam, sadly there are far too many systems that do not fllow the documented rules as far as cache tags are concerned. He is right, they are not complicated, sadly however, the rules are not observed.
"I do not agree with Sam, sadly there are far too many systems that do not fllow the documented rules as far as cache tags are concerned. He is right, they are not complicated, sadly however, the rules are not observed."
I think we both may be saying something quite similar. I agree with you that no matter what the "book" says you can never count on a browser/proxy to go and figure out that something needs refreshing and have it ALWAYS refresh - sometimes it will just dispaly the cached copy. You can, however, always count on a browser calling your script if you generate a unqiue URL. That was my point.
....Sam
I think we both may be saying something quite similar. I agree with you that no matter what the "book" says you can never count on a browser/proxy to go and figure out that something needs refreshing and have it ALWAYS refresh - sometimes it will just dispaly the cached copy. You can, however, always count on a browser calling your script if you generate a unqiue URL. That was my point.
....Sam
but you can always prevent the cache by adding something unique to the url so that the cache believes that it is different.
That is exactly what I am saying.
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!
My recommendation, which I will post in the Cleanup topic area, is to
split points between jhurst and elsamman.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
My recommendation, which I will post in the Cleanup topic area, is to
split points between jhurst and elsamman.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
print header( -expires => '-1d' );
But are you sure it is a problem in the first place? I don't think client A would have the report for client B in his cache in the first place. Not unless he requested it before.
It may be just you who is having the problem.
It's not obvious from your code, but shouldn't there be a parameter in there that tells you which client is making the request? How do you know which report to generate?