- OS: Ubuntu 14.04
- Apache: 2.4.12 (using PPA) - mod_expires, mod_headers
I am using GZIP for all SVG files. It works well with the following statement in a configuration file (not .htaccess)
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml
However, hitting F5, the browser will request the file to the server returning a 200 Status Code instead of returning the expected 304 Status Code.
If I remove AddOutputFilterByType then the server returns 304 but the content is not GZIPped.
Here are some raw request headers
NO GZIP (200 Status Code)
Accept-Ranges: bytes
Cache-Control: max-age=2592000
Connection: Keep-Alive
Content-Length: 689
Content-Type: image/svg+xml
Date: Thu, 02 Jul 2015 10:41:09 GMT
Etag: "2b1-5157f331b2480"
Expires: Sat, 01 Aug 2015 10:41:09 GMT
Keep-Alive: timeout=5, max=80
Last-Modified: Thu, 07 May 2015 15:02:26 GMT
Server: Apache
NO GZIP (304 Status Code)
Cache-Control: max-age=2592000
Connection: Keep-Alive
Date: Thu, 02 Jul 2015 10:39:12 GMT
Etag: "2b1-5157f331b2480"
Expires: Sat, 01 Aug 2015 10:39:12 GMT
Keep-Alive: timeout=5, max=71
Server: Apache
With GZIP
Accept-Ranges: bytes
Cache-Control: max-age=2592000
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 451
Content-Type: image/svg+xml
Date: Thu, 02 Jul 2015 10:38:45 GMT
Etag: "2b1-5157f331b2480-gzip"
Expires: Sat, 01 Aug 2015 10:38:45 GMT
Keep-Alive: timeout=5, max=75
Last-Modified: Thu, 07 May 2015 15:02:26 GMT
Server: Apache
Vary: Accept-Encoding
Thank you!