Re: cache-control

DavidSeanTaylor <[email protected]> Sat, 13 Aug 2016 09:27:06 -0700
Newsgroups gmane.comp.jakarta.jetspeed.user
Message-ID <[email protected]>
Did you add your class to the modules path in =
TurbineResources.properties?

module.packages=3Dorg.apache.jetspeed.modules
module.packages=3Dorg.apache.turbine.modules

> Do I need to extend JetspeedJspPage also?  this is also mentioned in =
the
> TurbineResources.properties
>  as below
>=20
> services.JspService.default.page =3D JetspeedJspPage11

Perhaps. Look in TurbineResources.properties, maybe this is set to .jsp? =
By default it is vm:

services.TemplateService.default.extension=3Dvm


> On Aug 13, 2016, at 8:09 AM, Usha Ladkani <[email protected]> =
wrote:
>=20
> Thank you so much.
> I tried this , but it did not work.
>=20
> Do I need to extend JetspeedJspPage also?  this is also mentioned in =
the
> TurbineResources.properties
>  as below
>=20
> services.JspService.default.page =3D JetspeedJspPage11
>=20
>=20
> On Fri, Aug 12, 2016 at 8:25 PM, DavidSeanTaylor =
<[email protected]>
> wrote:
>=20
>> Looks like you are using some release of Jetspeed-1. That project has =
been
>> retired since 2008.
>>=20
>> https://portals.apache.org/jetspeed-1/ <https://portals.apache.org/
>> jetspeed-1/>
>>=20
>>=20
>> Seems the cache header logic is hard-coded, so you=E2=80=99ll have to =
override
>> JetspeedVelocityPage in TurbineResources.properties with your own
>> implementation.
>>=20
>> See TurbineResources.properties
>> services.VelocityService.default.page =3D JetspeedVelocityPage
>> Then see JetspeedVelocityPage, it calls super.doBuildBeforeAction, =
which
>> contains the hard-coding in JetspeedTemplatePage.java:
>>=20
>> 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;
>> }
>>=20
>> 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.doBuildBeforeAction, and
>> then plug your handler into TurbineResources.properties
>>=20
>> services.VelocityService.default.page =3D MyVelocityPage
>>=20
>>=20
>>> On Aug 11, 2016, at 10:06 PM, Usha Ladkani <[email protected]>
>> wrote:
>>>=20
>>> It says - JetspeedResources.properties,v 1.1.1326.2 2012/05/31 =
21:38:56
>>>=20
>>> In this property I see below
>>>=20
>>> #########################################
>>> # 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
>>>=20
>>>=20
>>> #########################################
>>>=20
>>>=20
>>> Looks like this only can set Cache-Control to no-cache or max-age.:
>>>=20
>>> Can you please tell me which version are you using and share your
>>> JetspeedResources.properties
>>=20
>>=20