Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9781

[Sling Models] Caching doesn't work with Wrapped requests

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Sling Models Impl 1.4.12
    • Fix Version/s: Sling Models Impl 1.4.14
    • Component/s: Extensions
    • Labels:
      None

      Description

      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: Justin Edelson Radu Cotescu as discussed in Slack.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                justinedelson Justin Edelson
                Reporter:
                jelger Christophe Jelger
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m