Re: cache-control

Usha Ladkani <[email protected]> Sat, 13 Aug 2016 20:39:40 +0530
Newsgroups gmane.comp.jakarta.jetspeed.user
Message-ID <CAPa2pYs4HmpmcBn54Df13ttLpxd1vRXZPgU210jS95sf2xAE8Q@mail.gmail.com>
--001a1143f3526bb5070539f56344
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

sorry its services.JspService.default.page =3D JetspeedJspPage

On Sat, Aug 13, 2016 at 8:39 PM, Usha Ladkani <[email protected]> wrote=
:

> 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
>> been retired since 2008.
>>
>> https://portals.apache.org/jetspeed-1/ <https://portals.apache.org/je
>> tspeed-1/>
>>
>>
>> Seems the cache header logic is hard-coded, so you=E2=80=99ll have to ov=
erride
>> 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.doBuildBeforeAct=
ion, 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:5=
6
>> >
>> > 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
>> seconds
>> > #           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
>>
>>
>

--001a1143f3526bb5070539f56344--