[jira] [Reopened] (COCOON3-102) The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable

2012-06-20 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/COCOON3-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francesco Chicchiriccò reopened COCOON3-102:



After some work trying to make profit of this cacheable XIncludeTransformer, 
I've unfortunately come - maybe a little too late - to the conclusion that the 
current implementation couldn't simply work.

In fact, CachingPipeline asks all PipelineComponent for CacheKey instances 
*before* starting the pipeline execution so that it is able to see if there is 
anything in the Cache that can fulfill the current request.
This means that constructCacheKey() method should only build a CacheKey 
including information related to PipelineComponent's attributes and parameters.

This is not the case for XIncludeTransformer: an effective CacheKey should 
include the URLs to be included (xi:include href=.../) but such information 
is available only *after* execution, not when constructCacheKey() is invoked by 
CachingPipeline.

 The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable
 

 Key: COCOON3-102
 URL: https://issues.apache.org/jira/browse/COCOON3-102
 Project: Cocoon 3
  Issue Type: Improvement
  Components: cocoon-sax
Affects Versions: 3.0.0-alpha-3
Reporter: Simone Tripodi
Assignee: Francesco Chicchiriccò
 Fix For: 3.0.0-beta-1


 The org.apache.cocoon.sax.component.XIncludeTransformer is not a cacheable 
 pipeline component, it would be great to implement it as cacheable

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (COCOON3-102) The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable

2012-06-20 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/COCOON3-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francesco Chicchiriccò updated COCOON3-102:
---

Attachment: COCOON3-102.patch

This patch adds the capability to choose among some cache-wise behaviours:

1. always expire: every pipeline including XIncludeTransformer will not be 
cached, but the transformation result will always be correct

2. never expire: XIncludeTransformer will never make the including pipeline to 
expire, but the transformation result can be potentially incorrect

3. expire after X seconds: after the provided timeout, XIncludeTransformer will 
return an invalid CacheKey

 The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable
 

 Key: COCOON3-102
 URL: https://issues.apache.org/jira/browse/COCOON3-102
 Project: Cocoon 3
  Issue Type: Improvement
  Components: cocoon-sax
Affects Versions: 3.0.0-alpha-3
Reporter: Simone Tripodi
Assignee: Francesco Chicchiriccò
 Fix For: 3.0.0-beta-1

 Attachments: COCOON3-102.patch


 The org.apache.cocoon.sax.component.XIncludeTransformer is not a cacheable 
 pipeline component, it would be great to implement it as cacheable

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (COCOON3-102) The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable

2012-06-20 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/COCOON3-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francesco Chicchiriccò updated COCOON3-102:
---

Status: On Hold  (was: Reopened)

What do you think about the attached patch?

 The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable
 

 Key: COCOON3-102
 URL: https://issues.apache.org/jira/browse/COCOON3-102
 Project: Cocoon 3
  Issue Type: Improvement
  Components: cocoon-sax
Affects Versions: 3.0.0-alpha-3
Reporter: Simone Tripodi
Assignee: Francesco Chicchiriccò
 Fix For: 3.0.0-beta-1

 Attachments: COCOON3-102.patch


 The org.apache.cocoon.sax.component.XIncludeTransformer is not a cacheable 
 pipeline component, it would be great to implement it as cacheable

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COCOON3-102) The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable

2012-06-20 Thread Javier Puerto (JIRA)

[ 
https://issues.apache.org/jira/browse/COCOON3-102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13397580#comment-13397580
 ] 

Javier Puerto commented on COCOON3-102:
---

You are right, with current implementation it's very difficult to achieve this 
tasks but it's possible with the patch I did for COCOON3-100. Anyway, I didn't 
commited yet because I'm not entirely happy with the URLCacheKey 
implementation, the expires that you commented could be used in that class. ATM 
I don't have enough time to work with Cocoon 3 until this weekend so if you 
have, you could take a look and improve it.

 The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable
 

 Key: COCOON3-102
 URL: https://issues.apache.org/jira/browse/COCOON3-102
 Project: Cocoon 3
  Issue Type: Improvement
  Components: cocoon-sax
Affects Versions: 3.0.0-alpha-3
Reporter: Simone Tripodi
Assignee: Francesco Chicchiriccò
 Fix For: 3.0.0-beta-1

 Attachments: COCOON3-102.patch


 The org.apache.cocoon.sax.component.XIncludeTransformer is not a cacheable 
 pipeline component, it would be great to implement it as cacheable

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COCOON3-102) The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable

2012-06-20 Thread Javier Puerto (JIRA)

[ 
https://issues.apache.org/jira/browse/COCOON3-102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13397606#comment-13397606
 ] 

Javier Puerto commented on COCOON3-102:
---

The patch is working but the problem is that COCOON3-30 is blocking the issue. 
Summarizing:

As you pointed, I use a similar approach as old Cocoon 2.x does. I've created a 
CachedCacheKey that will store the CacheKey for a given key. First time 
IncludeTransformer is executed, the CacheKey is created and stored in the 
CachingCacheKey object in a Cache (SimpleCache implementation) with a given key 
(usually the request URL). Next time, that Cocoon ask for the CacheKey, it will 
be checked with the cached one.

The problem is the following, we use double check for caching: etag and last 
modified. If etag matches, we don't check the last-modified value (it's 
cached), otherwise Cocoon check the last-modified (here COCOON3-30 is breaking 
the caching). In the sample block for IncludeTransformer we have the same file 
included twice, but the difference is that one use the file:// protocol and the 
other uses the servlet:// protocol. URLCacheKey will check the etag and 
last-modified values, but the file:// implementation don't provide the etag 
information so Cocoon use last-modified as fallback and finally 
ParameterCacheKey breaks the cache.

You can test it easily with the sample block and changing the ParameterCacheKey 
value of last-modified to 0 for example, this way will work at least for 
testing. I had some improvements in local but I'm still not happy with the 
URLCacheKey impl.

I've commented the problem to Thorsten and he suggest that maybe we could 
migrate the SourceValidity from old Cocoon implementation. IMO the caching 
system from old Cocoon was OK, so I'm agree with him but means that we should 
have to change a lot of things. WDYT?

 The org.apache.cocoon.sax.component.XIncludeTransformer is not cacheable
 

 Key: COCOON3-102
 URL: https://issues.apache.org/jira/browse/COCOON3-102
 Project: Cocoon 3
  Issue Type: Improvement
  Components: cocoon-sax
Affects Versions: 3.0.0-alpha-3
Reporter: Simone Tripodi
Assignee: Francesco Chicchiriccò
 Fix For: 3.0.0-beta-1

 Attachments: COCOON3-102.patch


 The org.apache.cocoon.sax.component.XIncludeTransformer is not a cacheable 
 pipeline component, it would be great to implement it as cacheable

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira