Re: cache-control
Usha Ladkani <[email protected]> Sat, 13 Aug 2016 20:39:23 +0530
| Newsgroups | gmane.comp.jakarta.jetspeed.user |
|---|---|
| Message-ID | <CAPa2pYuXX0owYj6b-z_x_wrsLuuaRV5UP6fFc1pVNQJP-oBiyg@mail.gmail.com> |
--001a113fef8662379e0539f56249 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you so much. I tried this , but it did not work. Do I need to extend JetspeedJspPage also? this is also mentioned in the TurbineResources.properties as below services.JspService.default.page =3D JetspeedJspPage11 On Fri, Aug 12, 2016 at 8:25 PM, DavidSeanTaylor <[email protected]> wrote: > Looks like you are using some release of Jetspeed-1. That project has bee= n > retired since 2008. > > https://portals.apache.org/jetspeed-1/ <https://portals.apache.org/ > jetspeed-1/> > > > Seems the cache header logic is hard-coded, so you=E2=80=99ll have to ove= rride > JetspeedVelocityPage in TurbineResources.properties with your own > implementation. > > See TurbineResources.properties > services.VelocityService.default.page =3D JetspeedVelocityPage > Then see JetspeedVelocityPage, it calls super.doBuildBeforeAction, which > contains the hard-coding in JetspeedTemplatePage.java: > > switch (httpLifetime) > { > case -1: > break; > case 0: > data.getResponse().setHeader("Cache-Control", "no-cache"); > data.getResponse().setHeader("Pragma", "no-cache"); > data.getResponse().setDateHeader("Expires", 0); > data.getResponse().setDateHeader("Last-Modified", > System.currentTimeMillis()); > break; > default: > data.getResponse().setHeader("Cache-Control", "max-age=3D" + > httpLifetime); > data.getResponse().setDateHeader("Expires", > System.currentTimeMillis() + (httpLifetime * 1000)); > data.getResponse().setDateHeader("Last-Modified", > System.currentTimeMillis()); > break; > } > > To override this behavior, simply write your own velocity page handler > extending JetspeedVelocityPage, and override the doBuildBeforeAction to > include your required headers, don=E2=80=99t call super.doBuildBeforeActi= on, and > then plug your handler into TurbineResources.properties > > services.VelocityService.default.page =3D MyVelocityPage > > > > On Aug 11, 2016, at 10:06 PM, Usha Ladkani <[email protected]> > wrote: > > > > It says - JetspeedResources.properties,v 1.1.1326.2 2012/05/31 21:38:56 > > > > In this property I see below > > > > ######################################### > > # HTTP Page header # > > ######################################### > > # http.lifetime is the lifetime of the page as set in the > > # HTTP Headers > > # -1 =3D Do not set cache related headers (Jetspeed 1.3a1 behavior) > > # 0 =3D set the following http headers > > # Cache-Control =3D "no-cache" > > # Last-Modified =3D (current time) > > # Pragma =3D "no-cache" > > # Expires =3D "0" > > # n where n is the number of seconds: > > # Cache-Control =3D "max-age: n" where n is the number of sec= onds > > # Last-Modified =3D (current time) > > # Expires =3D (current time + n seconds) > > http.lifetime=3D1 > > > > > > ######################################### > > > > > > Looks like this only can set Cache-Control to no-cache or max-age.: > > > > Can you please tell me which version are you using and share your > > JetspeedResources.properties > > --001a113fef8662379e0539f56249--