You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (Jira)" <ji...@apache.org> on 2020/10/01 10:41:00 UTC

[jira] [Commented] (SLING-9781) [Sling Models] Caching doesn't work with Wrapped requests

    [ https://issues.apache.org/jira/browse/SLING-9781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17205411#comment-17205411 ] 

Radu Cotescu commented on SLING-9781:
-------------------------------------

[~jelger], I already commented in the PR. I think the actual issue has a larger scope than wrapped requests. I'll let [~justinedelson] have a deeper look, since it's his code and he knows better the way the caching should work.

> [Sling Models] Caching doesn't work with Wrapped requests
> ---------------------------------------------------------
>
>                 Key: SLING-9781
>                 URL: https://issues.apache.org/jira/browse/SLING-9781
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.4.12
>            Reporter: Christophe Jelger
>            Priority: Major
>             Fix For: Sling Models Impl 1.4.14
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The caching of Sling models doesn't work when the original {{SlingHttpServletRequest}} is wrapped in a request wrapper, like this is typically done in HTL scripts with the {{OnDemandReaderRequest}} wrapper.
> The solution is to use the original request when caching models so that any wrapping does not interfere with the caching. When someone enables caching for a model adapted from request, I think the expectation is that caching does happen whenever the original request is wrapped.
> I'll provide a PR with a fix.
> cc: [~justinedelson] [~radu] as discussed in Slack.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)