Bug 1409196 - When enabled "<IfModule mod_deflate.c>", refresh page 2nd or 3rd time, "304" code will not appear.
Summary: When enabled "<IfModule mod_deflate.c>", refresh page 2nd or 3rd time, "304" ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Web Server 3
Classification: Retired
Component: httpd
Version: 3.0.0
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
: ---
Assignee: Weinan Li
QA Contact: Michal Karm Babacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-30 06:38 UTC by xuzhan
Modified: 2020-03-27 19:43 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:43:54 UTC
Embargoed:


Attachments (Terms of Use)
Configuration files. (158.39 KB, application/zip)
2016-12-30 06:38 UTC, xuzhan
no flags Details

Description xuzhan 2016-12-30 06:38:51 UTC
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.

Comment 2 Masafumi Miura 2017-01-04 02:37:50 UTC
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"


Note You need to log in before you can comment on or make changes to this bug.