Wicket
  1. Wicket
  2. WICKET-5441

IResourceCachingStrategy implementations should only set caching if version matches

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.12.0, 7.0.0-M1
    • Fix Version/s: 6.13.0, 7.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      Implementations of IResourceCachingStrategy (FilenameWithVersionResourceCachingStrategy and QueryStringWithVersionResourceCachingStrategy) should only set cache duration to maximum if the version matches. Currently, if a user requests a resource with an arbitrary version, the version will be cached for one year (WebResponse.MAX_CACHE_DURATION). So people could polute proxy caches with potentially upcoming version.

        Activity

        Hide
        Stefan Fussenegger added a comment -

        I've submitted pull request #67 on github. There remains a question though: What is the appropriate caching if versions don't match? The application default used for my patch still is WebResponse.MAX_CACHE_DURATION (though at least configurable and only privately cacheable)

        Show
        Stefan Fussenegger added a comment - I've submitted pull request #67 on github . There remains a question though: What is the appropriate caching if versions don't match? The application default used for my patch still is WebResponse.MAX_CACHE_DURATION (though at least configurable and only privately cacheable)
        Hide
        Martin Grigorov added a comment -

        Thanks!

        I've applied your patch with a minor change - if the calculated version is not null then make the check and set the caching headers.

        Show
        Martin Grigorov added a comment - Thanks! I've applied your patch with a minor change - if the calculated version is not null then make the check and set the caching headers.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Stefan Fussenegger
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development