CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
Stop scripts being cached


New User

Jul 25, 2002, 9:49 AM

Post #1 of 3 (2039 views)
Stop scripts being cached Can't Post

* I searched on the forum and didn't find an answer so I decided to post the problem here.

Hi there, I 'm developing a new service and requires lots of perl scripts. But I'm having lots of problems with cache (under apache)

Theres one script that validates the entry from a login page.

If you enter the wrong user name it displays a message (wrong user bla bla...)

If you enter the wrong password it displays other message (wrong password)

If you enter the right data, it takes your to your personal page with all your data.

The thing is that if don't enter any data it displays a message. BUT

if you login in one computer and then call the same script in another, it takes you to the personal page. Even if you didn't enter any data. Thats because of cache.

When testing, I tried entering wrong user names and passwords and the right data, as part of the beta testing.

BUT at the end, when I go to the personal page (generated by the script)

it displays the right data.

When I refresh the page it says "WRONG PASSWORD"

refreshed again and says "WRONG USER"

refreshed again and takes me to the personal page

refreshed again and "WRONG USER" again

this happens almost randomly.

can anyone help me?

I read about http headers but I couldn't implement them. Anny suggestions?


Jul 25, 2002, 4:25 PM

Post #2 of 3 (2036 views)
Re: [hroldan] Stop scripts being cached [In reply to] Can't Post

hello, i had a similar problem with apache cache, in my case i loaded a frame into a web page, but when i changed the page loaded (it was the same page but the contents had changed, it was an exec-page) i didn't see any changes.

For example, i click to see a citizien status, and i see he's a civil, then i change it to a doctor and i click again to see his status, then i saw that it still was a civilian :(

I have solutionated this with javascript:

function teamRegistry(idTeam) {
document.all.teamInfoFrame.src = "cargando.html" = 'visible'
document.all.teamInfoFrame.src = "perl/"+idTeam
function torna2() {teamInfoFrame.location.reload(1);}

And it works. Be careful (if it is useful to you) because i you put 10 instead of 1000 the reload is not effective and the problem persist.

Any body knows a real way to eliminate all APACHE cache????? Pirate


New User

Jul 26, 2002, 7:45 AM

Post #3 of 3 (2031 views)
Re: [entius] Stop scripts being cached [In reply to] Can't Post

Hi there, thanks for your solution

I looked on the web and found that the cache supose to respect calls with "?" and lines with cgi-bin. In my case I created a cgi-bin but the scripts where cached too :(

Yesterday I was talking with a system administrator and a experienced webmaster in perl. The solution we found is creating a folder inside cgi-bin or use the real cgi-bin.

We found too that this lines are very useful fighting back the cache:

#!/usr/bin/perl -w

use strict;

print <<EOF;
Content-type: text/plain

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<h1>Hello world</h1>
<p>bie world!</p>

The pragma and no cache did worked avoiding the cache to be applied to the scripts.

The cache we are using is "squid". The sys admin told me that you can espefify the cache to ignore certain folders or files. That wasn't necessary here.

Thanks for your solution, I didn't came up with the idea of using javascript.

Hope this could help you too.

Best regards :)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives