Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 600 forks source link

Clientlibs unneeded cache refresh #2562

Closed wimsymons closed 3 years ago

wimsymons commented 3 years ago

Required Information

Expected Behavior

When enforceMd5 is switched off (default behaviour), a cache hit should not trigger a cache refresh of a clientlib.

Actual Behavior

When enforceMd5 is switched off, a cache refresh is triggered when the md5sum is present in the url. A message like:

com.adobe.acs.commons.rewriter.impl.VersionedClientlibsTransformerFactory Refreshing client libraries cache, because /etc.clientlibs/some/client/lib.min.b75fbc620015773fc1a9e5b000ac77b6 could not be found

is logged.

Steps to Reproduce

  1. Enable versioned clientlibs as documented
  2. Request any page from AEM with clientlibs on it
  3. Refresh the page a few times, so the versioned clientlib is requested and cached
  4. You see the message logged on every request
wimsymons commented 3 years ago

Added pull request with fixed + extra tests and the fix.