You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Herman Reintke <hr...@tauri.nl> on 2005/12/17 11:23:56 UTC

Jetspeed2 & caching & install

LS,

I am using the binary J2 installation with the Derbydatabase. On top of that an Apache webserver is installed to be able to access the J2 Portal, together with my other installs/pages using port 80.

This all workes but I found some specific issues with the installation.

1/ access path. 
There are (at least) two paths you need to define. 1/ Jetspeed (as expected) but also 2/ j2-admin.
The j2-admin path is acessed directly from ouitside and I had to configure the proxy to pass thru to the jetspeed tomcat.
Questions :
- Are there any other paths required ? 
- When will a separate path be used/needed ?

2/ Caching
Sometimes I only have access to my J2 environment from behind a proxyserver. With the standard install I noticed several occasions when I got "old pages" which were only refreshed to the correct onces after a "forced" get by the browser. I only checked a few pages pages but the most obvious were :
- main page, I regulary got the "admin logged in page"  instead of the anonymous page where youneed to login.
- Portal site manager
When working with the PSM The portal site browser and portal site detail are not updated when selecting.
I've come around this behaviour nor to forcing all responses to have the directive "cache-control no-cache'.
Checking the apache access log I see for example the portal site detail alway being requested as : GET /jetspeed/portal/_ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed would allow a proxyserver to serve cached content. 
Question :
- Are there any specific cache-control options to be set in J2 ?

3/ 404 errors
I see a number of pages not returned by the J2 environment 
"GET /jetspeed/decorations/layout/css/data-scoller.css HTTP/1.1" 404 1099
"GET /jetspeed/decorations/portlet/tigris/images/nw_maj_rond.gif HTTP/1.1" 404 1129
Maybe they are missging from the install

If more info needed please let me know.

Kind regards,

Herman Reintke

Re: Jetspeed2 & caching & install

Posted by Raphaël Luta <ra...@aptiwan.com>.
Le 17 déc. 05 à 16:31, Randy Watler a écrit :

> On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
>> LS,
>>
>> I am using the binary J2 installation with the Derbydatabase. On  
>> top of that an Apache webserver is installed to be able to access  
>> the J2 Portal, together with my other installs/pages using port 80.
>>
>> 2/ Caching
>> Sometimes I only have access to my J2 environment from behind a  
>> proxyserver. With the standard install I noticed several occasions  
>> when I got "old pages" which were only refreshed to the correct  
>> onces after a "forced" get by the browser. I only checked a few  
>> pages pages but the most obvious were :
>> - main page, I regulary got the "admin logged in page"  instead of  
>> the anonymous page where youneed to login.
>> - Portal site manager
>> When working with the PSM The portal site browser and portal site  
>> detail are not updated when selecting.
>> I've come around this behaviour nor to forcing all responses to  
>> have the directive "cache-control no-cache'.
>> Checking the apache access log I see for example the portal site  
>> detail alway being requested as : GET /jetspeed/portal/ 
>> _ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed  
>> would allow a proxyserver to serve cached content.
>> Question :
>> - Are there any specific cache-control options to be set in J2 ?
>
> I am not aware of any global configurations that can be set to add
> headers to all outgoing responses. Have you been able to verify  
> that all
> is well without the proxyserver in place?
>

The easiest way to manage cache control issues is to implement the  
caching policy
through the Apache HTTP server using mod_expires and possible  
mod_header.

Check the HTTPD documentation for usage of these 2 modules.

--
Raphaël Luta - raphael@apache.org
Apache Jetspeed - Enterprise Portal in Java
http://portals.apache.org/


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Randy Watler <wa...@wispertel.net>.
Herman,


> > 
> > 3/ 404 errors
> > I see a number of pages not returned by the J2 environment 
> > "GET /jetspeed/decorations/layout/css/data-scoller.css HTTP/1.1" 404 1099
> > "GET /jetspeed/decorations/portlet/tigris/images/nw_maj_rond.gif HTTP/1.1" 404 1129
> > Maybe they are missging from the install
> 
> Both of these files should exist, but may not be being located properly
> under all circumstances. Can you send a copy of your access log to me
> directly? Meanwhile, I'll be looking for similar occurrences here. 
> 

I have fixed these 404 issues for the 2.01 release.

Thanks again for the email... i am still working the outstanding cache
control issue.

Randy



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Raphaël Luta <ra...@apache.org>.
Herman Reintke wrote:
> LS,
> 
> I indeed used the apache http server (mod_header) to include the
> cache-control directive.
> Disadvantage however is that I needed to set cache-control no-cache for
> all responses as apache has no knowledge on what is being responded. And
> a lot of the responses can be cached without any problem.
> 

Well, since you only mentioned cache control for all jetspeed pages,
I thought mod_header was the most appropriate :) (using a <location>
block, you can make your cache statements apply only to *.psml URI and thus
still cache your images, css etc...).

It's seems like you'd like some more fine grain control on page caching
from jetspeed. Can you elaborate a bit on how you would like to manipulate
the cache settings ? per PSML page, per portlet, per portlet instance, per
authenticated user ?
It could be an interesting feature to add.

> Randy : without the proxyserver it indeed looks OK as distributed,
> although I did not check all.
> 
> Kind regards,
> 
> Herman Reintke
> 
> 
>>
>> Le 17 déc. 05 à 16:31, Randy Watler a écrit :
>>
>>> On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
>>>
>>>> LS,
>>>>
>>>> I am using the binary J2 installation with the Derbydatabase. On 
>>>> top of that an Apache webserver is installed to be able to access 
>>>> the J2 Portal, together with my other installs/pages using port 80.
>>>>
>>>> 2/ Caching
>>>> Sometimes I only have access to my J2 environment from behind a
>>>> proxyserver. With the standard install I noticed several occasions 
>>>> when I got "old pages" which were only refreshed to the correct 
>>>> onces after a "forced" get by the browser. I only checked a few 
>>>> pages pages but the most obvious were :
>>>> - main page, I regulary got the "admin logged in page"  instead of 
>>>> the anonymous page where youneed to login.
>>>> - Portal site manager
>>>> When working with the PSM The portal site browser and portal site
>>>> detail are not updated when selecting.
>>>> I've come around this behaviour nor to forcing all responses to 
>>>> have the directive "cache-control no-cache'.
>>>> Checking the apache access log I see for example the portal site 
>>>> detail alway being requested as : GET /jetspeed/portal/
>>>> _ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed 
>>>> would allow a proxyserver to serve cached content.
>>>> Question :
>>>> - Are there any specific cache-control options to be set in J2 ?
>>>
>>>
>>> I am not aware of any global configurations that can be set to add
>>> headers to all outgoing responses. Have you been able to verify  that
>>> all
>>> is well without the proxyserver in place?
>>>
>>
>> The easiest way to manage cache control issues is to implement the
>> caching policy
>> through the Apache HTTP server using mod_expires and possible 
>> mod_header.
>>
>> Check the HTTPD documentation for usage of these 2 modules.
>>

-- 
Raphaël Luta - raphael@apache.org
Apache Portals - Enterprise Portal in Java
http://portals.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Raphaël Luta <ra...@apache.org>.
Herman Reintke wrote:
> Raphaël,
> 
> I do not have specific ideas/requirements on caching. I noticed the
> behaviour of the binary distribution and reported it on the list.
> 

OK. I thought you had a specific use case in mind.

> On your solution, I think not only *.psml pages need the no-cache
> directive. I see also requests coming to for example /jetspeed/,
> /jetspeed/portal, /jetspeed/portal/administrative.
> Looks like requests to a "directory"  in which, based on the psml, and
> logged in user the page is build. These page should not be cached either.
> 
> But.., If you can define a generic way which URI should and should not
> be cached, it seems possible.
> 

I guess as long as you want to cache based on URI, mod_header/mod_expires
is the most flexible option, for example using something like below which should
prevent pages from being cached but no media documents.

# Should match any URI with either a .psml extension or no extensions:
# All these should match:
# /jetspeed/
# /jetspeed/portal/
# /jetspeed/portal/news.psml
<LocationMatch ^/jetspeed/(.*/[^.]*|.*\.psml)?$>
Header set Cache-Control no-cache
</LocationMatch>

# Optionally, set a 1 week expire on media objects
ExpiresActive on
ExpiresByType image/gif  		A604800	
ExpiresByType image/jpeg 		A604800	
ExpiresByType image/png  		A604800	
ExpiresByType text/css   		A604800	
ExpiresByType application/x-javascript  A604800	

-- 
Raphaël Luta - raphael@apache.org
Apache Portals - Enterprise Portal in Java
http://portals.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Herman Reintke <hr...@tauri.nl>.
Raphaël,

I do not have specific ideas/requirements on caching. I noticed the 
behaviour of the binary distribution and reported it on the list.

On your solution, I think not only *.psml pages need the no-cache directive. 
I see also requests coming to for example /jetspeed/, /jetspeed/portal, 
/jetspeed/portal/administrative.
Looks like requests to a "directory"  in which, based on the psml, and 
logged in user the page is build. These page should not be cached either.

But.., If you can define a generic way which URI should and should not be 
cached, it seems possible.

Kind regards,

Herman Reintke

----- Original Message ----- 
From: "Raphaël Luta" <ra...@apache.org>
To: "Jetspeed Users List" <je...@portals.apache.org>
Sent: Monday, December 19, 2005 12:06 PM
Subject: Re: Jetspeed2 & caching & install


> Herman Reintke wrote:
>> LS,
>>
>> I indeed used the apache http server (mod_header) to include the
>> cache-control directive.
>> Disadvantage however is that I needed to set cache-control no-cache for
>> all responses as apache has no knowledge on what is being responded. And
>> a lot of the responses can be cached without any problem.
>>
>
> Well, since you only mentioned cache control for all jetspeed pages,
> I thought mod_header was the most appropriate :) (using a <location>
> block, you can make your cache statements apply only to *.psml URI and 
> thus
> still cache your images, css etc...).
>
> It's seems like you'd like some more fine grain control on page caching
> from jetspeed. Can you elaborate a bit on how you would like to manipulate
> the cache settings ? per PSML page, per portlet, per portlet instance, per
> authenticated user ?
> It could be an interesting feature to add.
>
>> Randy : without the proxyserver it indeed looks OK as distributed,
>> although I did not check all.
>>
>> Kind regards,
>>
>> Herman Reintke
>>
>>
>>>
>>> Le 17 déc. 05 à 16:31, Randy Watler a écrit :
>>>
>>>> On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
>>>>
>>>>> LS,
>>>>>
>>>>> I am using the binary J2 installation with the Derbydatabase. On
>>>>> top of that an Apache webserver is installed to be able to access
>>>>> the J2 Portal, together with my other installs/pages using port 80.
>>>>>
>>>>> 2/ Caching
>>>>> Sometimes I only have access to my J2 environment from behind a
>>>>> proxyserver. With the standard install I noticed several occasions
>>>>> when I got "old pages" which were only refreshed to the correct
>>>>> onces after a "forced" get by the browser. I only checked a few
>>>>> pages pages but the most obvious were :
>>>>> - main page, I regulary got the "admin logged in page"  instead of
>>>>> the anonymous page where youneed to login.
>>>>> - Portal site manager
>>>>> When working with the PSM The portal site browser and portal site
>>>>> detail are not updated when selecting.
>>>>> I've come around this behaviour nor to forcing all responses to
>>>>> have the directive "cache-control no-cache'.
>>>>> Checking the apache access log I see for example the portal site
>>>>> detail alway being requested as : GET /jetspeed/portal/
>>>>> _ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed
>>>>> would allow a proxyserver to serve cached content.
>>>>> Question :
>>>>> - Are there any specific cache-control options to be set in J2 ?
>>>>
>>>>
>>>> I am not aware of any global configurations that can be set to add
>>>> headers to all outgoing responses. Have you been able to verify  that
>>>> all
>>>> is well without the proxyserver in place?
>>>>
>>>
>>> The easiest way to manage cache control issues is to implement the
>>> caching policy
>>> through the Apache HTTP server using mod_expires and possible
>>> mod_header.
>>>
>>> Check the HTTPD documentation for usage of these 2 modules.
>>>
>
> -- 
> Raphaël Luta - raphael@apache.org
> Apache Portals - Enterprise Portal in Java
> http://portals.apache.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Herman Reintke <hr...@tauri.nl>.
LS,

I indeed used the apache http server (mod_header) to include the 
cache-control directive.
Disadvantage however is that I needed to set cache-control no-cache for all 
responses as apache has no knowledge on what is being responded. And a lot 
of the responses can be cached without any problem.

Randy : without the proxyserver it indeed looks OK as distributed, although 
I did not check all.

Kind regards,

Herman Reintke


>
> Le 17 déc. 05 à 16:31, Randy Watler a écrit :
>
>> On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
>>> LS,
>>>
>>> I am using the binary J2 installation with the Derbydatabase. On  top of 
>>> that an Apache webserver is installed to be able to access  the J2 
>>> Portal, together with my other installs/pages using port 80.
>>>
>>> 2/ Caching
>>> Sometimes I only have access to my J2 environment from behind a 
>>> proxyserver. With the standard install I noticed several occasions  when 
>>> I got "old pages" which were only refreshed to the correct  onces after 
>>> a "forced" get by the browser. I only checked a few  pages pages but the 
>>> most obvious were :
>>> - main page, I regulary got the "admin logged in page"  instead of  the 
>>> anonymous page where youneed to login.
>>> - Portal site manager
>>> When working with the PSM The portal site browser and portal site 
>>> detail are not updated when selecting.
>>> I've come around this behaviour nor to forcing all responses to  have 
>>> the directive "cache-control no-cache'.
>>> Checking the apache access log I see for example the portal site  detail 
>>> alway being requested as : GET /jetspeed/portal/ 
>>> _ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed  would 
>>> allow a proxyserver to serve cached content.
>>> Question :
>>> - Are there any specific cache-control options to be set in J2 ?
>>
>> I am not aware of any global configurations that can be set to add
>> headers to all outgoing responses. Have you been able to verify  that all
>> is well without the proxyserver in place?
>>
>
> The easiest way to manage cache control issues is to implement the 
> caching policy
> through the Apache HTTP server using mod_expires and possible  mod_header.
>
> Check the HTTPD documentation for usage of these 2 modules.
>
> --
> Raphaël Luta - raphael@apache.org
> Apache Jetspeed - Enterprise Portal in Java
> http://portals.apache.org/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Randy Watler <wa...@wispertel.net>.
Herman,

Thanks for the feedback. See comments below.

Randy

On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
> LS,
> 
> I am using the binary J2 installation with the Derbydatabase. On top of that an Apache webserver is installed to be able to access the J2 Portal, together with my other installs/pages using port 80.
> 
> This all workes but I found some specific issues with the installation.
> 
> 1/ access path. 
> There are (at least) two paths you need to define. 1/ Jetspeed (as expected) but also 2/ j2-admin.
> The j2-admin path is acessed directly from ouitside and I had to configure the proxy to pass thru to the jetspeed tomcat.
> Questions :
> - Are there any other paths required ? 
> - When will a separate path be used/needed ?

Given that the different portlets and their associated application code
are deployed in webapps, I believe that it is always possible that these
webapps are accessed directly. It is then safest to add paths to all
deployed Jetspeed webapps in the Tomcat webapps directory.
 
> 
> 2/ Caching
> Sometimes I only have access to my J2 environment from behind a proxyserver. With the standard install I noticed several occasions when I got "old pages" which were only refreshed to the correct onces after a "forced" get by the browser. I only checked a few pages pages but the most obvious were :
> - main page, I regulary got the "admin logged in page"  instead of the anonymous page where youneed to login.
> - Portal site manager
> When working with the PSM The portal site browser and portal site detail are not updated when selecting.
> I've come around this behaviour nor to forcing all responses to have the directive "cache-control no-cache'.
> Checking the apache access log I see for example the portal site detail alway being requested as : GET /jetspeed/portal/_ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed would allow a proxyserver to serve cached content. 
> Question :
> - Are there any specific cache-control options to be set in J2 ?

I am not aware of any global configurations that can be set to add
headers to all outgoing responses. Have you been able to verify that all
is well without the proxyserver in place? 

These appear to be the only headers added for pages:

Set-Cookie: JSESSIONID=F5B35CB1E279026157BF0267A9176BC3; Path=/jetspeed
Content-Type: text/html;charset=UTF-8
Date: Sat, 17 Dec 2005 15:28:46 GMT
Server: Apache-Coyote/1.1
Connection: close

IMO, we should be adding the HTTP 1.0 "expires: 0" and HTTP 1.1
"cache-control: nocache" headers on all portal page responses. I will
consider getting this added for the 2.01 release that is currently
pending. Of course, the team will need to vote on this inclusion.

> 
> 3/ 404 errors
> I see a number of pages not returned by the J2 environment 
> "GET /jetspeed/decorations/layout/css/data-scoller.css HTTP/1.1" 404 1099
> "GET /jetspeed/decorations/portlet/tigris/images/nw_maj_rond.gif HTTP/1.1" 404 1129
> Maybe they are missging from the install

Both of these files should exist, but may not be being located properly
under all circumstances. Can you send a copy of your access log to me
directly? Meanwhile, I'll be looking for similar occurrences here. 

> 
> If more info needed please let me know.
> 
> Kind regards,
> 
> Herman Reintke


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Randy Watler <wa...@wispertel.net>.
Herman,

On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
> 2/ Caching
> Sometimes I only have access to my J2 environment from behind a proxyserver. With the standard install I noticed several occasions when I got "old pages" which were only refreshed to the correct onces after a "forced" get by the browser. I only checked a few pages pages but the most obvious were :
> - main page, I regulary got the "admin logged in page"  instead of the anonymous page where youneed to login.
> - Portal site manager
> When working with the PSM The portal site browser and portal site detail are not updated when selecting.
> I've come around this behaviour nor to forcing all responses to have the directive "cache-control no-cache'.
> Checking the apache access log I see for example the portal site detail alway being requested as : GET /jetspeed/portal/_ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which indeed would allow a proxyserver to serve cached content. 
> Question :
> - Are there any specific cache-control options to be set in J2 ?

I have set the following in JetspeedServlet.java in the 2.1-dev and
2.0.1 branch:

// ensure that no proxy or brower caching is performed
// on dynamic responses resulting from pipeline execution

// HTTP/1.1 modern browser/proxy
res.setHeader("Cache-Control", "no-cache,no-store,private");
// HTTP/1.0 non-standard proxy
res.setHeader("Pragma", "no-cache");
// HTTP/1.0 browser/proxy
res.setHeader("Expires", "0");

HTH,

Randy


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jetspeed2 & caching & install

Posted by Herman Reintke <hr...@tauri.nl>.
Randy,

I have build jetspeed 2.1 dev, removed my original workarounds and did some 
testing.
Results were OK. I wil continue using this. If I encounter issues I will 
send it to the list.
Thanks for the fix.

Kind regards,

Herman Reintke

----- Original Message ----- 
From: "Randy Watler" <wa...@wispertel.net>
To: "Jetspeed Users List" <je...@portals.apache.org>
Sent: Saturday, January 07, 2006 7:24 AM
Subject: Re: Jetspeed2 & caching & install


> Herman,
>
> On Sat, 2005-12-17 at 11:23 +0100, Herman Reintke wrote:
>> 2/ Caching
>> Sometimes I only have access to my J2 environment from behind a 
>> proxyserver. With the standard install I noticed several occasions when I 
>> got "old pages" which were only refreshed to the correct onces after a 
>> "forced" get by the browser. I only checked a few pages pages but the 
>> most obvious were :
>> - main page, I regulary got the "admin logged in page"  instead of the 
>> anonymous page where youneed to login.
>> - Portal site manager
>> When working with the PSM The portal site browser and portal site detail 
>> are not updated when selecting.
>> I've come around this behaviour nor to forcing all responses to have the 
>> directive "cache-control no-cache'.
>> Checking the apache access log I see for example the portal site detail 
>> alway being requested as : GET 
>> /jetspeed/portal/_ns:YXBkYi0xfGMwfGQwfGY_/Administrative/site.psml, which 
>> indeed would allow a proxyserver to serve cached content.
>> Question :
>> - Are there any specific cache-control options to be set in J2 ?
>
> I have set the following in JetspeedServlet.java in the 2.1-dev and
> 2.0.1 branch:
>
> // ensure that no proxy or brower caching is performed
> // on dynamic responses resulting from pipeline execution
>
> // HTTP/1.1 modern browser/proxy
> res.setHeader("Cache-Control", "no-cache,no-store,private");
> // HTTP/1.0 non-standard proxy
> res.setHeader("Pragma", "no-cache");
> // HTTP/1.0 browser/proxy
> res.setHeader("Expires", "0");
>
> HTH,
>
> Randy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org