NYCPHP Meetup

NYPHP.org

[nycphp-talk] Hmm, how to count 'online' users?

Michael mogmios at mlug.missouri.edu
Fri Aug 13 01:24:48 EDT 2004


>You can always attach a unique id to avoid caching:
>  
>
Any reason not to just set the cache info? Easy enough to do using 
either PHP or Apache and all major browsers handle it in at least 
something close to the right behavior.

I do something like this for static files in Apache:
 ExpiresActive on
 ExpiresDefault "access plus 1 minute"
 ExpiresByType image/jpeg "access plus 1 week"
 ExpiresByType image/png "access plus 1 week"
 ExpiresByType image/gif "access plus 1 week"

And I set the proper http headers for each of my PHP pages to get the 
same effect for scripts. Obviously to avoid caching rather than 
encouraging it as I have done you'd just change the life of the objects 
to something small.

--
Michael <mogmios at mlug.missouri.edu>
http://kavlon.org




More information about the talk mailing list