On Thu, 31 May 2001 22:25:43 +0200
Mikael Ståldal <[EMAIL PROTECTED]> wrote:

> At 15:38 2001-05-18 +0200, Sérgio Carvalho wrote:
> >Most times, a better alternative to offline content generation - when used 
> >as a cache - is to use a real frontside cache. Squid, for example, can be 
> >setup to do blind front side caching (blind, in the sense that it ignores 
> >HTTP response headers, and always assumes a configured TTL for the pages).
> 
> I haven't tried Squid, but how does it know when a page expires? To use the 
> same TTL for all pages is not useful for sites with any dynamic content. 
> How does it know which pages to update often, and which pages to not cache 
> at all?
> 

(This is slightly offtopic, but I think is usefull for cocoon users, so I post anyway)

In most sites you have a mixture of four types of content: 
 1) Static, long-time cacheable content. ex: images, static pages.
 2) Semi-static, content generated dynamically, with a known expiry date. ex: news 
headline pages, weather pictures. You can cache these for a couple of hours to a full 
day.
 3) Semi-dynamic, dynamically generated content, which should be updated on every 
request, but can be cached for short periods of time. The most common example is forum 
posts. You can update a forum every five minutes and get a workable forum. Even short 
cache periods - say one minute - make wonders for server load.
 4) Dynamic. Full dynamic pages, which must be updated on every request. Operation 
results, user-specific pages, etc

for user-specific pages, you can sometimes change a type 4 onto a type 3 with a 
redirect - such as when you just want to set user preferences for field ordering and 
filtering.

Front-side caching, (aka accelerator-mode proxying) can be useful on types 1-3. How do 
you define the TTL? Two options: 
 a) Have the various content types in different URL spaces - such that you can match 
them against a regexp. Then, set fixed TTLs for each one.
 b) Have the dynamic server produce valid TTLs for dynamic pages.

a) is easier to implement. b) is more elegant. Choose the one that fits you best. I 
usually try for the easy way first, and if that's to cumbersome, go for b).

Hope I helped,

Sergio


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to