Tag Info

Hot answers tagged

31

Yes, there is almost no reason I can think of to not use GZIP at all times. It's like getting free bandwidth, and it is universally supported. Always have it on! The only possible downsides are If you are on a shared host with very limited CPU resources, as the compression is done on the server and it does take a tiny bit of server CPU. The server would ...


12

Yes. 120KB for HTML alone(!) can be compressed greatly. Together with the CSS and JavaScript files. This will speed up the browsing experience for your users and save you bandwidth on your server. You could implement the compression using your server-side script and cache the compressed files, thus easing the pressure on the CPU on busy servers.


9

By far the easiest method is to use an online tool. GIDZipTest shows you plenty of detail: the original size, compressed size and compression percentage. However, it is possible in Chrome with a bit of effort. (Updated for latest Chrome, Sept 2011.) In the Developer Tools, go to the "Network" tab and reload the page. You will see a list of all the files ...


9

A few basic methods easily implementable by any website: Compress your HTML, CSS and Javascript with deflate or gzip if the browser who made the request supports it. Minify your javascript with Google Closure Compiler Minify your css with YUI Compressor A little more involved: If a page or image is unlikely to change, tell the browser to cache it. Most ...


8

I highly recommend Google Closure Compiler for compressing JavaScript code. I use it personally, and it is also the official compressor used by the jQuery project. This project can do quite a lot, but the basics are this: java -jar closure.jar -js javascriptFile.js > javascriptFile.min.js


7

It is unlikely that the compression level affects the decompression time. The tradeoff is in how much time/memory is spent in compression searching for the smallest way to express the input data — more compression isn't just extra layers of processing on both ends (that would be a good way to make the data larger). Once the data is compressed, decompressing ...


7

Is it good practice to use gzip or not? Depends upon your webserver's environment. If your server is running low on idle CPU time, adding GZIP deflation could actually slow down the rate at which your server responds to requests. If you're not presently dealing with a CPU bottleneck, however, GZIP deflation is a great idea but only for plain-text ...


6

Yes, Amazon Cloudfront can now serve GZip'ed / HTML Compressed content to end users fairly easily. This used to be rather hard, but Amazon added this to Cloudfront around November 2010. What you are looking for is called "custom origin". The gist of it is: You set up your own web server, and configure this server to correctly compress content for ...


5

This is absolutely worth doing, even for sites with average to low traffic levels. Although it will reduce your bandwidth (with a slight increase in CPU usage), the real benefit is to your users. Even on broadband you can notice a performance improvement when accessing compressed pages, but your users on slower network speeds and newer smartphones will ...


4

Google has outlined and explained their recommendations to best Minimize Payload Size. They include the following techniques: Enable compression Remove unused CSS Minify JavaScript Minify CSS Minify HTML Defer loading of JavaScript Optimize images Serve scaled images Serve resources from a consistent URL These suggestions are a part of their open-source ...


4

Download Firebug and install Google's Page Speed plugin and or Yahoo!'s YSlow plugin both of these will help you optimise around the background image. Also read Yahoo's Best Practices for Speeding Up Your Website


4

The quickest thing I can think of is Google's mod_pagespeed for Apache. I've used it on my Magento store and didn't have any issues with the combination of the JS and CSS, though did run into some issues with the caching and what have you, but you can turn those off pretty easily. With mod_pagespeed, you want to use these filters in you pagespeed.conf: # ...


4

The first thing to keep in mind is that compression checkers sometimes lie for various reasons, so take their warnings with a grian of salt. As a few people have recently said on Stack Overflow ySlow is not gospel (but I do like it myself). What I would suggest doing, rather than employing zlib.output_compression in php, is to enable mod_deflate in Apache. ...


3

Source While using BlogEngine.net you may run into “content encoding error” “The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression” this error, to resolve this, find <add name=”CompressionModule” type=”BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core”/> in ...


3

I use the following in the .htaccess on my bluehost account (as recommended by a friend) <Files ~ "^[^\.]+$"> ForceType application/x-httpd-php SetOutputFilter DEFLATE </Files> <FilesMatch "\.(js|css|html|htm|php|xml)$"> SetOutputFilter DEFLATE </FilesMatch> ExpiresActive on ExpiresByType image/png "access ...


3

This may be a problem if there is a server in between which is decompressing the content, such as a load-balancer, CDN, or proxy. If the content is sent encrypted on localhost, it will be sent encrypted to you unless there is a client in between which does not have the Accept-Encoding:gzip header in the request. The best way to check for compression is to ...


3

Put these lines in your .htaccess and PageSpeed Insights will see your gzip compression: <IfModule mod_deflate.c> <FilesMatch "\.(html|php|txt|xml|js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule> It works for my sites.


2

I use Justin Etheredge's SquishIt project. It is awesome! For asp.net only however. It uses YUI for CSS and Javascript compression. It supports LESS I believe it supports Google Closure It is ridiculously easy to use. Read the intro to squishit blog post. Here's some sample code that will render a single <script> tag and a single <link> tag. ...


2

The most used CSS compressor is YUI Compressor. It supports both JS and CSS. Talking about JS, Google Closure offers a more powerful set of features compared to YUI Compressor.


2

Won't work with IE6 browsers, but here's how WordPress users do it. http://perfectionlabstips.wordpress.com/2008/12/30/serving-gzipped-gz-files-as-compressed-css-javascript-html-content/ Their examples are for CSS and JavaScript, but it's easily applicable for .html from the samples. They show you how to detect for browsers that won't work and keep an ...


2

Google makes reference to gzip and image/binary files at Minimize payload size Don't use gzip for image or other binary files. Image file formats supported by the web, as well as videos, PDFs and other binary formats, are already compressed; using gzip on them won't provide any additional benefit, and can actually make them larger. To compress ...


2

No, in fact it could make things worse. From Yahoo's Best Practices for Speeding Up Your Web Site: Image and PDF files should not be gzipped because they are already compressed. Trying to gzip them not only wastes CPU but can potentially increase file sizes.


2

GZIP offers superior compression in most instances, but XML sitemaps just aren't that large to begin with. I would say that you shouldn't worry about it. Unless you have some very sizable sitemaps (ie: Approaching the 50,000 URL limit), I would say that the server's compression should be sufficient - at least to avoid the hassle of manually compressing them ...


2

The question here is why you would need to minify html, gzip should be fine on its own, the biggest single cost in front end speed is http requests at the server end and images in terms of pure bandwidth. HTML is so small it's barely worth the effort. I would suggest using tools like Google Page Speed or Yahoo!'s YSlow (and reading Yahoo!'s research on the ...


1

The Web Developer Toolbar for Firefox has a "View Document Size" item under the Information menu. (This option is missing in the Chrome version, for some reason.) It opens a tab that shows you overall size, broken down by section(images, scripts, stylesheets, etc) which you can toggle open for a detailed listing, in case you need to hunt down a particular ...


1

I don't know of any online tools personally, though if it were me I would just select your image folder(s) and html, js, stylesheet files and look at the collective filesize that way. There is always the page speed addon for Firefox/Chrome that will give you recommendations for other optimizations you can do to improve the speed of your site. Hope this ...


1

i think this might me what your looking for http://www.phpmybackuppro.net/ I use this for sites that on cheap shared hosting. It's main feature is to backup MYSQL, this makes it easy to automate rather than going via a control panel. however it will also compress whole directories. it can save the backups to the server, send them to a remote FTP server or ...


1

Have you tried to use gzip compression. This will bring you much more benefits than the standard compression. Also have in mind that compressing some JS files may bring you troubles. Last year I used internet by broadband connection(GSM network) where the provider`s proxy compressed all the content to lower the bandwidth and this causes me troubles with ...



Only top voted, non community-wiki answers of a minimum length are eligible