[lug] Safely Parsing PHP Parameters

dio2002 at indra.com dio2002 at indra.com
Wed Oct 10 14:58:15 MDT 2007


> Then use mod_expire (I think) in Apache to set that directory tree to
> cache for 10 years. (If you ever need to change the file contents in the
> future, change the path).  You should do this for your image files also.
> I noted with Firebug that the caching headers seem to be only the
> default If-Mod-Since Apache does automatically for static files.
>
> Or you could put an Expires header into the PHP output.
>
> Imagine if 10 people behind a company or ISP web proxy all hit your
> site.  With proper caching you get only 1 hit and save 9x bandwidth.

i'd recommend you only enable caching for such long periods once your site
content is relatively stable.  otherwise folks who've already downloaded
your pages won't be able to download any new changes unless you change the
file paths per above.  and that can be a pita if you have lots of content
that changes frequently and makes your site inconsistent across multiple
users.

i'd actually recommend that you do NOT cache in this manner unless you
have oodles of traffic.  it's not worth the hastle and the performance
will be negligble for light loads which the majority of websites usually
encounter.




More information about the LUG mailing list