Reputation: 1
I've compressed all the java scripts and style sheets as an individual files, after compression its about 582 KB. While it is loaded in the web page the chrome browser inspect elements network displays 168 KB, similarly when I browse in safari the network displays the file size as un-compressed 582 KB. It seems the compressing process has not occurred.
Many articles says that safari browser wont support the gzip compression.
Please guide me a to roll out this issue.!
Thanks in advance...!!
Upvotes: 0
Views: 831
Reputation: 2021
Yes, send as jgz for it to work in Safari and add some headers for IE. Here is a coldFusion example:
<cfheader name="Content-type" value="text/javascript">
<cfheader name="Vary" value="Accept-Encoding">
<cfheader name="Content-Encoding" value="gzip">
<cfheader name="Content-Disposition" value="inline; filename=""#cacheKey#.jgz""">
<cfcontent file="#file#" deleteFile="no">
Alternatively you can opt to not compress the concatenated file in your code, and let your web server do that work for you. Then there is nothing to wonder about. Here is that example code in IIS (web.config):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
...
Live Example using IIS for gzipping. The download is 40KB. The unzipped content is 110KB.
Safari only shows the unzipped size. But firebug shows the download size.
Upvotes: 0
Reputation: 158
This is may not be a perfect solution but this may help you
according to http://www.webveteran.com/blog/index.php/web-coding/coldfusion/fix-for-safari-and-gzip-compressed-javascripts/ you may try to send format as "jgz" instead "gz"
according to Why is gzip compression with Internet Explorer not working? you may check whether you are passing correct header
Content-Encoding : gzip
It can also be server side issue
Upvotes: 0