|
Posted by Philip Ronan on 06/20/05 11:25
"Jure Erznoznik" wrote:
> Non-caching is triggered by headers Pragma, expires, etc, which I am
> currently solving with this code:
> <?php
> session_start();
> header("Content-type: text/javascript");
> // Header("Expires: " . gmdate("D, d M Y H:i:s", mktime(5, 0, 0, 1, 1,
> 2020)) . " GMT");
> Header("Expires: ");
> Header("Cache-control: max-age=86400");
> Header("Pragma: ");
>
> This enables the browsers to recognise files as valid for 1 day, which is
> good enough for me.
>
> Is there a better way? How can I simply disable the Expires and Pragma
> headers instead of setting them blank? I searched the manual all over but
> can't find any function that would do this.
I don't think there's much you can do to improve cacheability when you're
using PHP sessions, because of all the dynamic data that gets added to the
search strings of every URL.
But anyway, you'll find more information on cacheability at
<http://www.mnot.net/cacheability/> and there's a cacheability assessment
tool at <http://www.ircache.net/cgi-bin/cacheability.py>
I hope that helps.
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Navigation:
[Reply to this message]
|