Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Making PHP Applications Cache-Friendly
One approach to minimising redundant transmission of data is the use of Last-Modified and If-Modified-Since headers as defined in HTTP/1.1.
In this scheme, each object returned by the webserver carries a date of last modification (a.k.a. "validator"). A user agent or proxy cache can store this value and, upon the next reload of the same object, issue a conditional GET query with the Last-Modified-Since header set. The webserver will then use this header to decide whether the client's copy of the object is still "fresh" (as recent as the data on the server) or "stale" (older than the data on the server). If it is fresh, there is no need to send the object again, so the server responds with a brief "304 Not Modified" message instead.
Modern webservers and user agents (e.g., Apache/1.3, Netscape Navigator 4.x and above, Internet Explorer) fully support this technique. Apache automatically handles If-Modified-Since requests for all static objects by default.
In the case of dynamic content as generated by PHP, we have to take care of these things manually. We need to return a meaningful Last-Modified header and handle If-Modified-Since requests so that the user agent gets fresh data if and only if necessary. For Phorum, this means that we have to keep track of database updates. If the database has not changed since the client's last request, we can simply return 304 without bothering the DBMS at all.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
This is a very influential speculative novel of Sex12/07/04 09:41
RE: Caching In A Highly Dynamic SystemFaceless09/23/03 09:14
RE: $HTTP_IF_MODIFIED_SINCE not presentjazzz04/03/03 04:16
Flash & PHP Cache ProblemphpMax08/27/02 06:16
RE: PHPNuke CacheingShadow07/03/02 08:27
$HTTP_IF_MODIFIED_SINCE not presentEd Fair05/02/02 15:02
Cache Help pleaseAJA05/01/02 20:55
GD and cache?Toast04/23/02 08:15
RE: Other kind of cache-ingMichael Svazas03/24/02 02:32
Other kind of cache-ingCatalin BOIE03/07/02 05:20
Kindly Help Me!shahid03/02/02 09:34
RE: making a wap pageGenau Junior02/22/02 16:32
making a wap pageCan Tabur02/13/02 08:40
Caching In A Highly Dynamic Systemlucitech02/11/02 11:31
Some general commentsterry chay02/03/02 09:50
RE: about cookiesLexa02/01/02 09:48
checksumApokalyptik01/15/02 01:28
RE: PHPNuke CacheingWebparadise01/04/02 17:36
RE: PHPNuke Cacheingwaddy12/09/01 15:30
RE: PHPNuke Cacheingwaddy12/08/01 14:31
RE: PHPNuke Cacheingching12/07/01 04:24
RE: PHPNuke CacheingGorka Valecnia12/03/01 18:02
RE: PHPNuke CacheingSvante12/03/01 04:27
RE: PHPNuke Cacheingjose alberto toledo11/30/01 10:48
PHPNuke Cacheingwaddy11/27/01 11:28
about cookiesReza11/22/01 10:36
$HTTP_IF_MODIFIED_SINCE not sent by default?B@rt11/22/01 03:28
RE: plz help mail meSvante11/20/01 09:17
$HTTP_IF_MODIFIED_SINCEPaul11/19/01 08:24
plz help mail meJocke11/17/01 20:42
Affects banner impressionsCSN11/17/01 00:49
Updating LoggingCSN11/16/01 17:58
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.