• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

disable cache on apache

netdiver

New Pleskian
Hi folks.

Here is my problem:
(Linux 9.3 - Plesk 7.5 - apache 2)

I'm developing Perl scripts and currently I have a very fascinating issue.
When I'm calling my scripts with different parameters first (...com/bla.pl?u=user&rand=4711) and afterwards calling the same script a couple of times with only one parameters ...com/bla.pl?u=user) my random values from previous calls show up again from time to time.

Ok, I disabled Caching in my browsers (tried IE & Firefox) and also used the META Tags in html output of scripts to prevent caching, but it seems that Apache itself caches some answers.
Has anybody any idea where I could disable this glorious feature?
Btw. there are no hints in the log files .. the scripts work fine .. (I also tried it with lynx on the local mashine .. same effect.)

In the documentation I only found some features on enabling caching, but nothing about disabling it completely - or at least for one domain ?!?

Anybody any ideas?

All the best,

NetDiver
 
Ok, .. I found the problem:
An unitialized hash table.

You can try it by yourself.
Just push some url parameters to an uninitialized hash table and print out every key / value as result of the cgi script.
If you reduce the number of parameters you'l still find the old values in your hash table.

Bugfix:
Intialize the Hash Table first.
%bla = ( );

Ahhhrggg ... I'm coding C/C++ for quiet a lot time and this is always the first thing I take a look at, when things go wrong. But in Perl ?!?! - Well well ...

Clean code is something wonderful !

So far ..

NetDiver
 
Netdiver,

Thanks for posting the solution to your problem. We have a set of scripts on our server that have worked flawlessly for years on other equipment. Once located on our new equipment we were experiencing the same randomness issues you were.

Just want to say thanks :D for taking the time to post your solution. It saved us hours of research.

GDotts
 
Back
Top