Created attachment 1236042 [details] Configuration files. Description of problem: Customer would like to web browser load CSS/JS from local cache when refresh page(press F5) in short time. However the CSS/JS will get "200" code instead of "304" if set "<IfModule mod_deflate.c>" in JWS's httpd.conf Version-Release number of selected component (if applicable): JWS 3.0.2 Mod_cluster JBoss EAP 6.4.12 How reproducible: Can be reproduced at our side. Steps to Reproduce: 1. Set up environment JWS 3.0.2 + Mod_cluster + JBoss EAP 6.4.12 2. Edit ${JWS_HOME}/conf/httpd.conf as below: ~~~ <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/javascript </IfModule> ~~~ 3. Deploy a war contains CSS/JS files into EAP. 4. Visit http://localhost:80/app, check the CSS/JS has "200" response code. 5. Press F5, the CSS/JS still have "200" response code. 6. Comment "AddOutputFilterByType DEFLATE text/css" then restart JWS. 7. Repeat step 4th and 5th, the CSS will got "304" response code. Actual results: Static files were loaded from server not local cache. Expected results: Static files will be loaded from local cache if files not changed in server. Additional info: Attached configuration files from customer.
I think this behavior is related to DeflateAlterETag setting: http://httpd.apache.org/docs/trunk/en/mod/mod_deflate.html#deflatealteretag The DeflateAlterETag directive only exists in trunk and it has not yet been backported to httpd 2.4. So, it's same to "DeflateAlterETag AddSuffix" and the behavior can not be changed by configuration in httpd 2.4. That's why mod_deflate prevents serving "HTTP Not Modified" (304) responses to conditional requests for compressed content. It's better to backport DeflateAlterETag featrue to httpd 2.4 from trunk. As workaround at this moment, you can remove ETag header by using mod_headers. For example: "Header unset ETag"