Wicket
  1. Wicket
  2. WICKET-4762

IResourceVersion should be based on final result

    Details

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

      Description

      MessageDigestResourceVersion generates a hash of the file content which will be used as the version. As of now this doesn't take transformations by CSS/JS compressors into account.

      This is problematic if you have a faulty compressor and your clients have already downloaded such a resource. By fixing the compressor you achieve nothing because the client happily keeps its faulty compressed version (by default for one year) as the hash didn't change. You either have to change the resource file (which is difficult for built in resources) or change the mapper path. The same holds true for other compressor improvements.

      This issue isn't really limited to only compressors. If a resource output isn't only based on the resource file input then a wrong hash will be generated. IResourceVersion should always make the decision on the final output.

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          Fixed by processing the input stream for both the cacheable resource stream that is used for the calculation of the version and the "normal" stream used for the actual response.

          The only drawback/regression is that now the passed Attributes to #processResponse() does not contain the parsed PageParameters.
          The bug is more important and the application can use attributes.getRequest().getRequestParameters() if those are needed.

          Show
          Martin Grigorov added a comment - Fixed by processing the input stream for both the cacheable resource stream that is used for the calculation of the version and the "normal" stream used for the actual response. The only drawback/regression is that now the passed Attributes to #processResponse() does not contain the parsed PageParameters. The bug is more important and the application can use attributes.getRequest().getRequestParameters() if those are needed.

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Christoph Leiter
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development