You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Mullan Colm <Co...@uk.fujitsu.com> on 2009/07/29 13:04:06 UTC

DONT cache specific weblog comments page

Hi Folks

 

Is there a mechanism to only cache some weblog pages?

 

I would like to turn off caching for the comments page only, without
turning off caching for all weblog content.

 

For example I don't want to set the following to false: for all content.

 

# Weblog page cache (all the weblog content)

cache.weblogpage.enabled=false

 

If this cannot be done by configure in the properties file settings,
could you point out in the code where the weblog cache is added and
based on the page name I could manually add logic to don't cache the
comments page.

 

I am using roller 3.1.

 

Many Thanks Colm


Re: DONT cache specific weblog comments page

Posted by Dave <sn...@gmail.com>.
Hi Mullan,

You might be able to do what you want by writing/modifying some code
because Roller has to do something similar to what you want to do. In
Roller, we support pluggable comment authenticators. For example there
is a math authenticator that presents a math question and we cannot
cache the question because then it would never change. So, we generate
part of the comment page on the server side and fetch it via Ajax to
the client side.

Take a look at these files:
   clientSideInclude.js
   weblog.vm

And take a look at the implementations of CommentAuthenticator.java

You might be able to do what you want to do by writing your own
CommentAuthenticator.

Thanks,
- Dave


On Tue, Aug 4, 2009 at 9:44 AM, Mullan Colm<Co...@uk.fujitsu.com> wrote:
> Hi Dave,
>
> Thanks for the reply.
>
> I have an issue where I am extracting user details from a cookie to
> appear on the comments name/email fields on the comments page. With
> caching turned on different user details are populated incorrectly due
> to caching. As the cookie information is not retrieved as the comments
> page is cached initially.
> When caching is turned off, the issue is resolved.
> But I would rather not turn caching off for all weblogs as this will be
> a performance hit.
>
> I would like to know if we could prevent caching on a particular page
> (i.e. comments page ONLY).
>
> If I can't update the code to omit a particular page from the cache
> system, then I may have to re-think a new solution.
>
> I was thinking if something like the following would be possible to-do:
>        on the PageServlet check what page we are on and thus don't
> create a WeblogPageCache instance if on the comments page.
>
> If you have any ideas - all is welcome.
>
> Thanks Colm
>
> -----Original Message-----
> From: Dave [mailto:snoopdave@gmail.com]
> Sent: 04 August 2009 04:17
> To: user@roller.apache.org
> Subject: Re: DONT cache specific weblog comments page
>
> Roller doesn't support caching of comments pages only.
>
> Why would anybody want to do that? Maybe there is another way to do
> what you want to do.
>
> - Dave
>
>
>
> On Wed, Jul 29, 2009 at 7:04 AM, Mullan Colm<Co...@uk.fujitsu.com>
> wrote:
>> Hi Folks
>>
>>
>>
>> Is there a mechanism to only cache some weblog pages?
>>
>>
>>
>> I would like to turn off caching for the comments page only, without
>> turning off caching for all weblog content.
>>
>>
>>
>> For example I don't want to set the following to false: for all
> content.
>>
>>
>>
>> # Weblog page cache (all the weblog content)
>>
>> cache.weblogpage.enabled=false
>>
>>
>>
>> If this cannot be done by configure in the properties file settings,
>> could you point out in the code where the weblog cache is added and
>> based on the page name I could manually add logic to don't cache the
>> comments page.
>>
>>
>>
>> I am using roller 3.1.
>>
>>
>>
>> Many Thanks Colm
>>
>>
>

RE: DONT cache specific weblog comments page

Posted by Mullan Colm <Co...@uk.fujitsu.com>.
Hi Dave,

Thanks for the reply.

I have an issue where I am extracting user details from a cookie to
appear on the comments name/email fields on the comments page. With
caching turned on different user details are populated incorrectly due
to caching. As the cookie information is not retrieved as the comments
page is cached initially.
When caching is turned off, the issue is resolved.
But I would rather not turn caching off for all weblogs as this will be
a performance hit.

I would like to know if we could prevent caching on a particular page
(i.e. comments page ONLY).

If I can't update the code to omit a particular page from the cache
system, then I may have to re-think a new solution.

I was thinking if something like the following would be possible to-do:
	on the PageServlet check what page we are on and thus don't
create a WeblogPageCache instance if on the comments page.

If you have any ideas - all is welcome.

Thanks Colm 

-----Original Message-----
From: Dave [mailto:snoopdave@gmail.com] 
Sent: 04 August 2009 04:17
To: user@roller.apache.org
Subject: Re: DONT cache specific weblog comments page

Roller doesn't support caching of comments pages only.

Why would anybody want to do that? Maybe there is another way to do
what you want to do.

- Dave



On Wed, Jul 29, 2009 at 7:04 AM, Mullan Colm<Co...@uk.fujitsu.com>
wrote:
> Hi Folks
>
>
>
> Is there a mechanism to only cache some weblog pages?
>
>
>
> I would like to turn off caching for the comments page only, without
> turning off caching for all weblog content.
>
>
>
> For example I don't want to set the following to false: for all
content.
>
>
>
> # Weblog page cache (all the weblog content)
>
> cache.weblogpage.enabled=false
>
>
>
> If this cannot be done by configure in the properties file settings,
> could you point out in the code where the weblog cache is added and
> based on the page name I could manually add logic to don't cache the
> comments page.
>
>
>
> I am using roller 3.1.
>
>
>
> Many Thanks Colm
>
>

Re: DONT cache specific weblog comments page

Posted by Dave <sn...@gmail.com>.
Roller doesn't support caching of comments pages only.

Why would anybody want to do that? Maybe there is another way to do
what you want to do.

- Dave



On Wed, Jul 29, 2009 at 7:04 AM, Mullan Colm<Co...@uk.fujitsu.com> wrote:
> Hi Folks
>
>
>
> Is there a mechanism to only cache some weblog pages?
>
>
>
> I would like to turn off caching for the comments page only, without
> turning off caching for all weblog content.
>
>
>
> For example I don't want to set the following to false: for all content.
>
>
>
> # Weblog page cache (all the weblog content)
>
> cache.weblogpage.enabled=false
>
>
>
> If this cannot be done by configure in the properties file settings,
> could you point out in the code where the weblog cache is added and
> based on the page name I could manually add logic to don't cache the
> comments page.
>
>
>
> I am using roller 3.1.
>
>
>
> Many Thanks Colm
>
>