The external proxy cache will be used only in anonymous access because of the problem inconstent cache. Most off the sites are anonymous access. So in the file "declarations.inc", I've had this. But I don't know how-to calculate the dLastPublicationTime date.
//
Definition des headers en fonction des droits des utilisateurs // Si on est en anonyme --> utilisation du cache Apachelogger
.debug("Page " + jData.page().getID() + " (" + jData.page().getTitle() + ")"); if (!jData.gui().isLogged()){
int iCacheMaxExpire = 24*3600; Date dExpires = new Date();dExpires
.setTime(dExpires.getTime() + iCacheMaxExpire); Date dLastPublicationTime = new Date(); // <--- How to calculate this date ?logger
.debug("Header Expires = " + getDateAsRFC822String(dExpires));logger
.debug("Header Last-Modified = " + getDateAsRFC822String(dLastPublicationTime));logger
.debug("Header Cache-Control = " + "max-age=" + iCacheMaxExpire + ", must-revalidate");response
.addHeader("Expires", getDateAsRFC822String(dExpires));response
.addHeader("Last-Modified", getDateAsRFC822String(dLastPublicationTime));response
.addHeader("Cache-Control", "max-age=" + iCacheMaxExpire + ", must-revalidate");}
// Autrement --> pas de cache Apache else{
Date dExpiresAbsolute = new Date();dExpiresAbsolute
.setTime(dExpiresAbsolute.getTime() + 86400);logger
.debug("Header Cache-Control = no-cache");logger
.debug("Header Pragma = No-Cache");logger
.debug("Header ExpiresAbsolute = " + getDateAsRFC822String(dExpiresAbsolute));logger
.debug("Header Expires = -1");response
.addHeader("Cache-Control", "no-cache");response
.addHeader("Pragma", "No-Cache");response
.addHeader("ExpiresAbsolute", getDateAsRFC822String(dExpiresAbsolute));response
.addHeader("Expires", "-1");}
Mmmh it risks to be a bit less trivial than that.... Content may be reused on several pages (so you can't simply flush the current page). Moreover, on the same page, you can have various different permissions. etc, etc... So replacing the current jahia HTML cache by an external cache proxy is not so simple and rapidly your cache proxxy will become inconsistent. We are now working for Jahia 5.0 on a new full cache server which will be compliant with the ESI standard (= you can manage HTML fragments on a page and not only full pages). Meanwhile it seems to me more easy to just embed some JSP cache taglibs (cf OSCache HTML tags for instance) in your set of templates rather than trying to configure an external cache proxy. Cheers, Stéphane At 11:22 25.11.2005, ghislain\.cussonneau wrote: Hi ! CEO - Jahia Ltd, 45 rue de la gare, 1260 Nyon (Switzerland) Jahia : The Java Unified Web Platform www.jahia.org - The community and product web site www.jahia.com - Our commercial services company www.collaborativesource.org - The Collaborative Source Initiative |
Ghislain CUSSONNEAU
DIRR/DPIL/CIS
CAP 44, Rue Marcel Sembat
44000 Nantes
02 51 84 48 80
CRIL Technology
Technoparc de l'Aubinière
44000 Nantes
02 51 89 64 50
Accédez au courrier électronique de La Poste : www.laposte.net ;
3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn)
