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

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

Christophe Jelger created SLING-9781:
----------------------------------------

             Summary: [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
             Fix For: Sling Models Impl 1.4.14


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)