[Seaside] Requests & Components Caching

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Seaside] Requests & Components Caching

littleSmalltalker
Hi all,
I've taken the time to implement issue 435 and encountered some issues.

1. I have created a caching filter which caches the response according to the request URL using WACache. It uses the request url without the query params (i.e. aRequestContext request url withoutQuery). This causes problems however with WAComponent>>#script, which uses the same URL (without query params) and therefore serves the content of the page (instead of the contents of the #script method). Any suggestions how to solve this?

2. I think it's also important to provide component caching, so that individual components can be cached. (Rational: navigation components that pull data from databases should be cached, instead of generated each time) I guess the way to do this is to add a decoration around a component, and use that as a cache for the component's contents. However, the contents of the component is inserted through a canvas, which writes its contents directly to the returned document. We can use an additional document and get its output specifically for the component caching, however this feel a bit awkward. Any other ideas how to get a component's output so it can be cached?


Cheers,
Avi.

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

littleSmalltalker
Anybody?

On Mon, Mar 7, 2011 at 11:45 PM, Avi Shefi <[hidden email]> wrote:
Hi all,
I've taken the time to implement issue 435 and encountered some issues.

1. I have created a caching filter which caches the response according to the request URL using WACache. It uses the request url without the query params (i.e. aRequestContext request url withoutQuery). This causes problems however with WAComponent>>#script, which uses the same URL (without query params) and therefore serves the content of the page (instead of the contents of the #script method). Any suggestions how to solve this?

2. I think it's also important to provide component caching, so that individual components can be cached. (Rational: navigation components that pull data from databases should be cached, instead of generated each time) I guess the way to do this is to add a decoration around a component, and use that as a cache for the component's contents. However, the contents of the component is inserted through a canvas, which writes its contents directly to the returned document. We can use an additional document and get its output specifically for the component caching, however this feel a bit awkward. Any other ideas how to get a component's output so it can be cached?


Cheers,
Avi.


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

Philippe Marschall
In reply to this post by littleSmalltalker
2011/3/7 Avi Shefi <[hidden email]>:
> Hi all,
> I've taken the time to implement issue 435 and encountered some issues.
>
> 1. I have created a caching filter which caches the response according to
> the request URL using WACache. It uses the request url without the query
> params (i.e. aRequestContext request url withoutQuery). This causes problems
> however with WAComponent>>#script, which uses the same URL (without query
> params) and therefore serves the content of the page (instead of the
> contents of the #script method). Any suggestions how to solve this?

Include the query parameters in the cache key as well?

> 2. I think it's also important to provide component caching,

I don't think we wanna go there.

> so that
> individual components can be cached. (Rational: navigation components that
> pull data from databases should be cached, instead of generated each time)

That should be the responsibility of the database layer (ie. Glorp) or
business layer but not the GUI layer (Seaside).

> I
> guess the way to do this is to add a decoration around a component, and use
> that as a cache for the component's contents. However, the contents of the
> component is inserted through a canvas, which writes its contents directly
> to the returned document. We can use an additional document and get its
> output specifically for the component caching, however this feel a bit
> awkward. Any other ideas how to get a component's output so it can be
> cached?

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

littleSmalltalker
Phillipe,
re query parameters - obviously, but aren't the seaside params (_k,_s) get new values each time the page is rendered?
re component caching - why we don't want to go this way?

About your comment about the database layer - I disagree. Navigational elements can be cached, without the need to call the render chain. I think it is valuable to have components' output cached.

Cheers,
Avi.
On Sun, Mar 13, 2011 at 12:34 PM, Philippe Marschall <[hidden email]> wrote:
2011/3/7 Avi Shefi <[hidden email]>:
> Hi all,
> I've taken the time to implement issue 435 and encountered some issues.
>
> 1. I have created a caching filter which caches the response according to
> the request URL using WACache. It uses the request url without the query
> params (i.e. aRequestContext request url withoutQuery). This causes problems
> however with WAComponent>>#script, which uses the same URL (without query
> params) and therefore serves the content of the page (instead of the
> contents of the #script method). Any suggestions how to solve this?

Include the query parameters in the cache key as well?

> 2. I think it's also important to provide component caching,

I don't think we wanna go there.

> so that
> individual components can be cached. (Rational: navigation components that
> pull data from databases should be cached, instead of generated each time)

That should be the responsibility of the database layer (ie. Glorp) or
business layer but not the GUI layer (Seaside).

> I
> guess the way to do this is to add a decoration around a component, and use
> that as a cache for the component's contents. However, the contents of the
> component is inserted through a canvas, which writes its contents directly
> to the returned document. We can use an additional document and get its
> output specifically for the component caching, however this feel a bit
> awkward. Any other ideas how to get a component's output so it can be
> cached?

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

Philippe Marschall
2011/3/14 Avi Shefi <[hidden email]>:
> Phillipe,
> re query parameters - obviously, but aren't the seaside params (_k,_s) get
> new values each time the page is rendered?

Yes. And they render differently every time that's why we can't cache
applications.

> re component caching -
> why we don't want to go this way?

I have seen where this leads with jsp tag and stateful session bean
caching, and the fundamental problems are the same. In addition
creating new components has never been a problem.

> About your comment about the database layer - I disagree. Navigational
> elements can be cached, without the need to call the render chain.

But why? It has never been a performance problem.

> I think
> it is valuable to have components' output cached.

I think that's too complicated. The output may depend on the state of
the component and many other times like the current time.

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

littleSmalltalker
Well, if we can't cache the #script element, then we can't cache using query params (_k and _s keep changing).
I implemented caching of a request handler, however #script and #style should be left out of this (as they cannot be differentiated from the page itself). But then again, when we use forms and call:answer: , the URL never changes, only _k and _s change. So we can't cache anything.
So.. where how do we continue on issue 435? Is there any point of having page cache if we can't differentiate between pages?


About component caching - it seems logical to me, however since Seaside relies on components all the way, this one is far-fetch.

Cheers,
Avi.
On Tue, Mar 15, 2011 at 5:31 PM, Philippe Marschall <[hidden email]> wrote:
2011/3/14 Avi Shefi <[hidden email]>:
> Phillipe,
> re query parameters - obviously, but aren't the seaside params (_k,_s) get
> new values each time the page is rendered?

Yes. And they render differently every time that's why we can't cache
applications.

> re component caching -
> why we don't want to go this way?

I have seen where this leads with jsp tag and stateful session bean
caching, and the fundamental problems are the same. In addition
creating new components has never been a problem.

> About your comment about the database layer - I disagree. Navigational
> elements can be cached, without the need to call the render chain.

But why? It has never been a performance problem.

> I think
> it is valuable to have components' output cached.

I think that's too complicated. The output may depend on the state of
the component and many other times like the current time.

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside] Requests & Components Caching

Philippe Marschall
2011/3/15 Avi Shefi <[hidden email]>:
> Well, if we can't cache the #script element, then we can't cache using query
> params (_k and _s keep changing).
> I implemented caching of a request handler, however #script and #style
> should be left out of this (as they cannot be differentiated from the page
> itself). But then again, when we use forms and call:answer: , the URL never
> changes, only _k and _s change. So we can't cache anything.

We can cache, but only the things that are cacheable. Nothing about a
WAApplication is cacheable. But other request handlers have the
potential to be cacheable.

> So.. where how do we continue on issue 435? Is there any point of having
> page cache if we can't differentiate between pages?
>
>
> About component caching - it seems logical to me, however since Seaside
> relies on components all the way, this one is far-fetch.

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev