You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by andrew dunn <an...@luibh.com> on 2003/12/10 01:38:51 UTC

mod_perl caching/delay

Hi,

I've just moved a shopping cart I've been working on into mod_perl, and
fortunately it all seems to have worked straight away without any code
changes.

There is one problem though related to the what seems like caching of
pages. I'm building each page of categories based on the category id
passed in, and when I access one page (e.g. cat_id=10), followed quickly
by another of a different category (e.g. cat_id=15) I always get the
original page again (cat_id=10).

Evened forced refreshing of the page by holding shift in the browser,
and setting the expired header to yesterday don't fix it.

However, if I then leave the site alone for a minute or two, and refresh
the page I will get the new page that I wanted (cat_id=15). 

It seems to me like mod_perl is somehow caching the results of the
script for a short time, and if its called quickly again it will just
send out the same results without accepting new parameters. Is there a
way to disable this or prevent it from behaving like this ?

I'm running apache-1.3.27ensim-0ensim10 and mod_perl-1.26-5. I can't
upgrade because my server is running ensim.

Thanks for any pointers.

Andy.

-- 
Luibh.com
E: support@luibh.com
W: http://www.luibh.com

Web Hosting and Development.


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mod_perl caching/delay

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2003-12-09 at 19:38, andrew dunn wrote:
> There is one problem though related to the what seems like caching of
> pages. I'm building each page of categories based on the category id
> passed in, and when I access one page (e.g. cat_id=10), followed quickly
> by another of a different category (e.g. cat_id=15) I always get the
> original page again (cat_id=10).

In addition to what others said about globals, you may be accidentally
creating closures which maintain the value of lexical variables.  If you
post a simple test case that demonstrates the problem, we could probably
tell you what's wrong.

- Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mod_perl caching/delay

Posted by Thomas Klausner <do...@zsi.at>.
Hi!

On Wed, Dec 10, 2003 at 12:38:51AM +0000, andrew dunn wrote:

> It seems to me like mod_perl is somehow caching the results of the
> script for a short time, and if its called quickly again it will just
> send out the same results without accepting new parameters. Is there a
> way to disable this or prevent it from behaving like this ?

mod_perl is quite likely not chaching your results. Maybe there's a problem
with passing the cat_id to the DB. Try to add a debug statement there to see
if you're actually getting the right value.

You can run Apache with the -X option to make it easier to track things down
(there will be only one Apache process)

I find using command line http request quite helpful in such cases, because
they definitly do not cache anything on the clientside. Try
  lwp-request http://yourserver/foo?cat_id=10


-- 
#!/usr/bin/perl                               http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html