Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
varian has some good points on the way mod_perl works. That could be your problem.

This could also be a caching issue, and nothing to do with mod_perl: what happens is that the browser, or a proxy server at the ISP, caches the web page that you produce.

So, when the user requests the same page again, it's served out of the cache, rather than being requested again from your server.

Obviously this is great for static content, but a bit of a problem for content that changes each time it's requested. It can't always be solved by getting the user to change their browser settings (even if that were practical for a public site, which it usually isn't) because the problem can also be caused by reverse caching proxy servers between your server and the user. AOL used to be particularly bad for this, I don't know if they still are.

Anyway, the solution I've always used, which has the virtue of simplicity, is to append the time to the end of the URL when you request it. Obviously you need to arrange things so that the link to the dynamic page is itself dynamically generated. So you just need to make your HTML something like this:

'<A HREF="http://www.example.com/script.pl?r='.time().'">'

The reason that works is that the caching proxy server - or the browser - sees it as a request for a different URI to the previous one, so doesn't return the cached copy.

You can also play around with HTTP headers and so on to (in theory) prevent caching - my experience has been that this will work OK for the browser, but not necessarily for caching proxy servers.

HTH!

Best wishes, andye


In reply to Re: weired problem with mod_perl by andye
in thread weired problem with mod_perl by opensourcer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-23 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found