You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by codetester <ra...@gmail.com> on 2008/08/26 23:54:58 UTC

Tapestry query on URLs and Memcached

Hi,

I am new to Tapestry and trying to evaluate it for a personal project ( I am
current using struts2). Could someone help me in the following queries?

1) Is it possible to support the following URL structures out of the box? 
www.myhost.com/
www.myhost.com/category/
www.myhost.com/category/cat1/page1/xyz ...

2) Is is possible to conditionally plug in some cache ( like memcached ), so
that I can serve the entire processed HTML ( including the response header )
directly to the servlet response stream? ( In case of a cache miss, then the
normal flow would happen and I would conditionally cache the entire HTML
output ). 

Thanks!
-- 
View this message in context: http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p785361.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

Re: Tapestry query on URLs and Memcached

Posted by Josh Canfield <jo...@thedailytube.com>.
The short answer is yes.
There are hooks for doing both of those. The first is pretty standard look
at the docs.
For the second, while caching like this is not directly supported, you can
add a hook in your code that can conditionally cache your entire page
response. Take a look at PageRenderRequestFilter.

Josh
On Tue, Aug 26, 2008 at 2:54 PM, codetester <ra...@gmail.com> wrote:

>
> Hi,
>
> I am new to Tapestry and trying to evaluate it for a personal project ( I
> am
> current using struts2). Could someone help me in the following queries?
>
> 1) Is it possible to support the following URL structures out of the box?
> www.myhost.com/
> www.myhost.com/category/
> www.myhost.com/category/cat1/page1/xyz ...
>
> 2) Is is possible to conditionally plug in some cache ( like memcached ),
> so
> that I can serve the entire processed HTML ( including the response header
> )
> directly to the servlet response stream? ( In case of a cache miss, then
> the
> normal flow would happen and I would conditionally cache the entire HTML
> output ).
>
> Thanks!
> --
> View this message in context:
> http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p785361.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: Tapestry query on URLs and Memcached

Posted by Fernando Padilla <fe...@alum.mit.edu>.
A caching filter should have nothing to do with Tapestry, as long as you 
set the Expires headers properly.  To that end, I don't believe tapestry 
has any support for caching built in.

Though there is no general caching filter backed by memcache, you could 
look at Ehcache's implementation of caching filter, and port their code 
to be backed by Memcache.

Then the next question would be how would you set the proper expires 
headers for the appropriate requests.  That you could integrate into 
tapestry some how; maybe through page meta data, or some other filter 
(j2ee filter, or tapestry request filter or etc etc).  The filter would 
look at the incoming request and decide what the expires header you want 
will be (like 1hr for *.jpg, or "/start", etc etc).


This was a very quick and short reply, is it enough to get you started?



codetester wrote:
> Hi,
> 
> I am new to Tapestry and trying to evaluate it for a personal project ( I am
> current using struts2). Could someone help me in the following queries?
> 
> 1) Is it possible to support the following URL structures out of the box? 
> www.myhost.com/
> www.myhost.com/category/
> www.myhost.com/category/cat1/page1/xyz ...
> 
> 2) Is is possible to conditionally plug in some cache ( like memcached ), so
> that I can serve the entire processed HTML ( including the response header )
> directly to the servlet response stream? ( In case of a cache miss, then the
> normal flow would happen and I would conditionally cache the entire HTML
> output ). 
> 
> Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: [T4.1] Application works fine with Jetty, doesn't work so good with Tomcat

Posted by Craig Spry <Cr...@redflex.com.au>.
Hello All,

I've found out today that I have this setting in my jetty configuration:

<systemProperty>
                            <name>org.apache.tapestry.disable-caching</name>
                            <value>true</value>
</systemProperty>

When I remove this it behaves the same at it does when running under Tomcat.  Now I've read in the documentation that it is not a good idea to do this in a production environment, is there another way that I can get this page to not be loaded from the cache other than turning this off.

Thanks,

Craig

-----Original Message-----
From: Craig Spry [mailto:CraigS@redflex.com.au]
Sent: Wednesday, 27 August 2008 5:01 PM
To: Tapestry users
Subject: [T4.1] Application works fine with Jetty, doesn't work so good with Tomcat

Hello All,

I have a Tapestry 4.1 application that uses a Tacos Tree, which is built from information in a database.  This tree isn't visible from all pages in our application.  Now when I go to the page that has the tree on it and then navigate to a page without the tree on it and make a change which should change the tree and then navigate back to the tree page, I get the following behavior:
Jetty:
Tree looks like it should.
Tomcat:
Tree looks the way it did before the change.

Now is there any setting in tomcat that would change the way the page with the tree on it loads?

Thanks,
Craig Spry

If you are not an authorised recipient of this e-mail, please contact me at Redflex immediately by return phone call or by email. In this case, you should not read, print, retransmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments are confidential and may contain privileged information and/or copyright material of Redflex or third parties. You should only retransmit, distribute or commercialise the material if you are authorised to do so. This notice should not be removed.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


If you are not an authorised recipient of this e-mail, please contact me at Redflex immediately by return phone call or by email. In this case, you should not read, print, retransmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments are confidential and may contain privileged information and/or copyright material of Redflex or third parties. You should only retransmit, distribute or commercialise the material if you are authorised to do so. This notice should not be removed.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[T4.1] Application works fine with Jetty, doesn't work so good with Tomcat

Posted by Craig Spry <Cr...@redflex.com.au>.
Hello All,

I have a Tapestry 4.1 application that uses a Tacos Tree, which is built from information in a database.  This tree isn't visible from all pages in our application.  Now when I go to the page that has the tree on it and then navigate to a page without the tree on it and make a change which should change the tree and then navigate back to the tree page, I get the following behavior:
Jetty:
Tree looks like it should.
Tomcat:
Tree looks the way it did before the change.

Now is there any setting in tomcat that would change the way the page with the tree on it loads?

Thanks,
Craig Spry

If you are not an authorised recipient of this e-mail, please contact me at Redflex immediately by return phone call or by email. In this case, you should not read, print, retransmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments are confidential and may contain privileged information and/or copyright material of Redflex or third parties. You should only retransmit, distribute or commercialise the material if you are authorised to do so. This notice should not be removed.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry query on URLs and Memcached

Posted by Toby Hobson <to...@googlemail.com>.
I'm not too familiar with the Tapestry pipeline/chain of command system
which is why I chose to use a servlet filter. Other's might like to comment
on the benefits of the Tapestry approach. It's certainly possible to cache
on a page level using the servlet filter through the filter-mapping element.

As for authentication and cookie interception: I haven't done this myself
because I use acegi, but acegi is basically a servlet filter which
intercepts requests so I guess it must be possible!

You may want to have a look at these excellent articles:
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=1
http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html

Toby

2008/8/27 codetester <ra...@gmail.com>

>
> Thanks Toby and others!
>
> Toby, is there a difference in using Servlet v/s tapestry filter for
> caching
> the page response? As in, is one of the method more preferred? Because, in
> my case, I want to cache the response on certain pages like
> www.myhost.com/category/cat1/ and not www.myhost.com/category/help etc .
>
> Also, is using T apestry filters the right way to port authentication and
> cookie interceptor ( the current code that I have in struts ) ?
>
> Thanks!
>
> Toby Hobson-3 wrote:
> >
> > Tapestry 5 supports the url structure you mentioned using the "activation
> > context". I'm not familiar with memcached but it is certainly possible to
> > cache the entire page response using either a servlet or tapestry filter
> > (i'm currently using a servlet filter for some high-load pages e.g. the
> > home
> > page)
> >
> > Toby
> >
> > 2008/8/26 codetester <ra...@gmail.com>
> >
> >>
> >> Hi,
> >>
> >> I am new to Tapestry and trying to evaluate it for a personal project (
> I
> >> am
> >> current using struts2). Could someone help me in the following queries?
> >>
> >> 1) Is it possible to support the following URL structures out of the
> box?
> >> www.myhost.com/
> >> www.myhost.com/category/
> >> www.myhost.com/category/cat1/page1/xyz ...
> >>
> >> 2) Is is possible to conditionally plug in some cache ( like memcached
> ),
> >> so
> >> that I can serve the entire processed HTML ( including the response
> >> header
> >> )
> >> directly to the servlet response stream? ( In case of a cache miss, then
> >> the
> >> normal flow would happen and I would conditionally cache the entire HTML
> >> output ).
> >>
> >> Thanks!
> >> --
> >> View this message in context:
> >>
> http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p785361.html
> >> Sent from the Tapestry Users mailing list archive at Nabble.com.
> >>
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p786126.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry query on URLs and Memcached

Posted by codetester <ra...@gmail.com>.
Thanks Toby and others!

Toby, is there a difference in using Servlet v/s tapestry filter for caching
the page response? As in, is one of the method more preferred? Because, in
my case, I want to cache the response on certain pages like
www.myhost.com/category/cat1/ and not www.myhost.com/category/help etc .

Also, is using T apestry filters the right way to port authentication and
cookie interceptor ( the current code that I have in struts ) ?

Thanks!

Toby Hobson-3 wrote:
> 
> Tapestry 5 supports the url structure you mentioned using the "activation
> context". I'm not familiar with memcached but it is certainly possible to
> cache the entire page response using either a servlet or tapestry filter
> (i'm currently using a servlet filter for some high-load pages e.g. the
> home
> page)
> 
> Toby
> 
> 2008/8/26 codetester <ra...@gmail.com>
> 
>>
>> Hi,
>>
>> I am new to Tapestry and trying to evaluate it for a personal project ( I
>> am
>> current using struts2). Could someone help me in the following queries?
>>
>> 1) Is it possible to support the following URL structures out of the box?
>> www.myhost.com/
>> www.myhost.com/category/
>> www.myhost.com/category/cat1/page1/xyz ...
>>
>> 2) Is is possible to conditionally plug in some cache ( like memcached ),
>> so
>> that I can serve the entire processed HTML ( including the response
>> header
>> )
>> directly to the servlet response stream? ( In case of a cache miss, then
>> the
>> normal flow would happen and I would conditionally cache the entire HTML
>> output ).
>>
>> Thanks!
>> --
>> View this message in context:
>> http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p785361.html
>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p786126.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry query on URLs and Memcached

Posted by Toby Hobson <to...@googlemail.com>.
Tapestry 5 supports the url structure you mentioned using the "activation
context". I'm not familiar with memcached but it is certainly possible to
cache the entire page response using either a servlet or tapestry filter
(i'm currently using a servlet filter for some high-load pages e.g. the home
page)

Toby

2008/8/26 codetester <ra...@gmail.com>

>
> Hi,
>
> I am new to Tapestry and trying to evaluate it for a personal project ( I
> am
> current using struts2). Could someone help me in the following queries?
>
> 1) Is it possible to support the following URL structures out of the box?
> www.myhost.com/
> www.myhost.com/category/
> www.myhost.com/category/cat1/page1/xyz ...
>
> 2) Is is possible to conditionally plug in some cache ( like memcached ),
> so
> that I can serve the entire processed HTML ( including the response header
> )
> directly to the servlet response stream? ( In case of a cache miss, then
> the
> normal flow would happen and I would conditionally cache the entire HTML
> output ).
>
> Thanks!
> --
> View this message in context:
> http://n2.nabble.com/Tapestry-query-on-URLs-and-Memcached-tp785361p785361.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>