Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1409196

Summary: When enabled "<IfModule mod_deflate.c>", refresh page 2nd or 3rd time, "304" code will not appear.
Product: [Retired] JBoss Web Server 3 Reporter: xuzhan
Component: httpdAssignee: Weinan Li <weli>
Status: CLOSED EOL QA Contact: Michal Karm Babacek <mbabacek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: jdoyle, mmiura, pslavice, rsvoboda
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:43:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Configuration files. none

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"