MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Avoid gzip on images with query string
Current time: 06-05-2020, 02:33 PM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Avoid gzip on images with query string
02-14-2012, 04:22 AM (This post was last modified: 02-14-2012 04:32 AM by Joel.)
Post: #1
Avoid gzip on images with query string

I know it's not recommended to gzip images (not sure exactly why though) so I used this code in the httpd config file to gzip everything besides images
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

Everything seems to be working fine, however; I just noticed that images with query strings (like /sample.php?id=123456.jpg) are in fact being gziped (See Results)

is there any way I can filter these out?

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Avoid gzip on images with query string - Joel - 02-14-2012 04:22 AM

Forum Jump:

User(s) browsing this thread: 1 Guest(s)