You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AEM Version, including Service Packs, Cumulative Fix Packs, etc: 6.5.1
ACS AEM Commons Version: 4.3.2
Reproducible on Latest? yes
Expected Behavior
If I start a vanilla AEM with sample content and configure the ETag Digest Servlet filter as well as Apache/Dispatcher according to the manual, then I expect that subsequent requests to a cached resource (browser and dispatcher cache) returns a 304 status code.
Actual Behavior
When I curl cached resources with the header "If-None-Match: ${ETag}", I only receive the status code 200.
Steps to Reproduce
I start with a vanilla AEM including sample content (we-retail) together with the Apache/Dispatcher. The Servlet is configured as
# Configuration created by Apache Sling JCR Installer
messageDigestAlgorithm="MD5"
considerResponseHeaders=B"true"
salt=""
overwrite=B"false"
enabled=B"true"
addAsHtmlComment=B"true"
service.ranking=I"2147483647"
ignoredResponseHeaders=["Date","Cache-Control","Expires","Vary"]
enabledForOutputStream=B"true"
sling.filter.pattern=".*"
In the Apache, I adjusted conf.d/available_vhosts/aem_publish.vhost to contain
FileETag None
/conf.dispatcher.d/available_farms/999_ams_publish_farm.any to contain
Not that these filenames refer to a default web server setup provided by AMS. I set also in conf.dispatcher.d/filters/ams_publish_filters.any
/0001 { /type "allow" /url "*" }
due to issues when accessing the webpage via the dispatcher (but this is not related to the issue at hand.
Then I browse to the ${dispatcher-vhost}/content/we-retail.htmland the site is rendered and cached. The headers are cached as well, including the ETag header and they are also delivered from the dispatcher to the client.
Subsequently, I send of a curl request, e.g.,
curl -k -I -A "test" --header 'If-None-Match: 87abc740b1dc88e4ecfb67f82e707fa8' http://aem-publish:4503/content/we-retail/us/en.header_include.html
As a result, I get a status code 200. Looking into the cached header, I see the content
curl -k -I -A "test" --header 'If-None-Match: "87abc740b1dc88e4ecfb67f82e707fa8"' http://aem-publish:4503/content/we-retail/us/en.header_include.html
This time, I receive a status code 304, as desired. My suspicion is that the ETag servlet should answer with an ETag header as string and not as integer, such that the web server can cache it correctly.
The text was updated successfully, but these errors were encountered:
kwin
changed the title
ETag header not properly delivered from the servlet
ETag header not properly delivered from the servlet (missing quotes)
Sep 20, 2019
kwin
added a commit
to kwin/acs-aem-commons
that referenced
this issue
Sep 20, 2019
Required Information
Expected Behavior
If I start a vanilla AEM with sample content and configure the ETag Digest Servlet filter as well as Apache/Dispatcher according to the manual, then I expect that subsequent requests to a cached resource (browser and dispatcher cache) returns a 304 status code.
Actual Behavior
When I curl cached resources with the header "If-None-Match: ${ETag}", I only receive the status code 200.
Steps to Reproduce
I start with a vanilla AEM including sample content (we-retail) together with the Apache/Dispatcher. The Servlet is configured as
In the Apache, I adjusted
conf.d/available_vhosts/aem_publish.vhost
to contain/conf.dispatcher.d/available_farms/999_ams_publish_farm.any
to containin the
/cache
section.Not that these filenames refer to a default web server setup provided by AMS. I set also in
conf.dispatcher.d/filters/ams_publish_filters.any
due to issues when accessing the webpage via the dispatcher (but this is not related to the issue at hand.
Then I browse to the
${dispatcher-vhost}/content/we-retail.html
and the site is rendered and cached. The headers are cached as well, including the ETag header and they are also delivered from the dispatcher to the client.Subsequently, I send of a curl request, e.g.,
As a result, I get a status code 200. Looking into the cached header, I see the content
According to this stackoverflow discussion, an ETag value field should contain a string. Therefore I change the cached header to
and curl
This time, I receive a status code 304, as desired. My suspicion is that the ETag servlet should answer with an ETag header as string and not as integer, such that the web server can cache it correctly.
The text was updated successfully, but these errors were encountered: