Victor Kimura
asked on
gzip js not displaying in headers?
Hi,
I'm trying to see if my javascript files are zipped and being sent properly by the server. I checked in the Chrome Developer Tools (see attached files) to see snapshots of my headers for the a javascript file.
I have this in my .htaccess file:
I think I'm being redundant for the sections but I'm just checking to see if any of the code works. It doesn't seem like it. Am I missing something?
Thanks
Screenshot-2013-12-09-08.53.16.png
I'm trying to see if my javascript files are zipped and being sent properly by the server. I checked in the Chrome Developer Tools (see attached files) to see snapshots of my headers for the a javascript file.
I have this in my .htaccess file:
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
AddEncoding gzip .gz
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT}
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]
I think I'm being redundant for the sections but I'm just checking to see if any of the code works. It doesn't seem like it. Am I missing something?
Thanks
Screenshot-2013-12-09-08.53.16.png
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there a way I can see if the server is sending the gzipped version or the non-gzipped version with firebug or Chrome developer tools?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh, ok. I get it. I thought I could even manually change it but since it works on a different 'layer' then I get it now. Yes, makes sense. I was also trying to see what the server was sending - the .gz or the regular file. There should be a way to debug if the gzip is working properly or not though for specific js files or even css files.
Thanks for the help, Dave. That's helpful.
Thanks for the help, Dave. That's helpful.
You're welcome. I think something is telling people they can 'speed up' their web sites by 'Gzipping' their content. Unfortunately, it fails to tell them that it is not under their control. In addition, small files don't get gzipped because it takes more time to gzip them that than it does to simply send them.
ASKER
<script type="text/javascript" src="./controller/06_sixth
But the minified and the regular js file works fine. I'm just testing here to see if the manual gzipped file works or not. Is there something wrong with it?
The gzipped file is much smaller than the regular file. So why wouldn't the server send the gzipped version?