Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5446

Improve version matching in resource caching strategies

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.12.0, 7.0.0-M1
    • Fix Version/s: 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      From https://issues.apache.org/jira/browse/WICKET-5263?focusedCommentId=13846285&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13846285:

      The implementation of isVersion(..) isn't obvious as there naturally is one problem: The version depends on the resource and the resource isn't
      known without properly stripping the version from the URL. I'd therefore suggest to the method getVersionPattern() to IResourceVersion.
      The implementations for all current implementations would be trivial:
      LastModifiedResourceVersion: "[0-9]+" = timestamp in ms
      MessageDigestResourceVersion: "[0-9A-F]+" = hex value (uppercase)
      StaticResourceVersion: Pattern.quote(version)
      CachingResourceVersion and RequestCycleCachedResourceVersion: delegate.getVersionPattern()
      Making this pattern optional (i.e. return null) would retain the current behavior. Sure, it's still prone to errors (e.g. if version prefix is '-' and the
      resource is foo-1.png -> foo.png) but at least it avoids some (or probably most) errors (e.g. foo-bar1.png).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mgrigorov Martin Tzvetanov Grigorov
                Reporter:
                mgrigorov Martin Tzvetanov Grigorov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: