[Zope] - A simple counter...

Brian Lloyd Brian@digicool.com
Mon, 4 Jan 1999 11:41:14 -0500


> I'm having a slight proglem with a simple counter...
> I've made an external method that increments a Folder 
> property and then
> returns it, which I use to maintain a hit-count on my main page. The
> problem is, that this doesn't work like with the simple web
> page/cgi-solution I had before. Then it would update the 
> count once for
> each session where you visited the page, and using a cached 
> version of the
> page the rest of the time. Now, it counts every time you look 
> at the page,
> and gives an unrealistically high hit-count... Is there a simple way
> around this, or do I have to start tracking who has visited? (Maybe I
> could use a cookie for that...)

You can use DTML scripting to set HTTP Response headers -
it sounds like you just need to add a snippet of DTML in
with your call to the counter which sets appropriate caching
headers for the client (note that "appropriate" varies by
client -- you'll probably need a few different cache headers
to ensure that most clients will understand one of them).


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com