I read some articles about HTTP headers compression. Today I installed YSlow and it recommends that I compress the resources (text/html, javascript, css and images). Now I'm reading the documentation for Apache mod_deflate but in the example don't compress images.
Should I or should I not compress images in my site?
Your images should already be compressed - any extra compression won't have any noticeable effect on filesize, but will increase processing time.
.png files use DEFLATE compression already.
.jpg files generally use lossy compression.
.gif files use LZW compression.
Compressing files that have already been compressed very rarely results in a reduction in filesize, and can often increase filesize.
Images such as GIF, JPEG or PNG are already compressed via highly specialized algorithms that achieve better result than general purpose algorithms such as deflate.
Therefore, re-compressing them yields little to no gain in size, and can even make files bigger, with the added cost of server-side processing.
So, in other words... do not compress images.
SVGs should be compressed by Apache mod_deflate as
AddType image/svg+xml svg
AddOutputFilterByType DEFLATE image/svg+xml
More information at https://httpd.apache.org/docs/2.4/mod/mod_deflate.html.
Related
In my cpanel, threre is 30GB Project file, i am trying to compress it and downloading
but unfortunatly, file compression is taken too much time.
can you suggest any efficient way to compress it and can download easily
My images coming from Contentful doesn't seems to be gzip compressed. Is there any setting that I need to make?
This link talks about that this is possible but I couldn't find any such setting. Can you please let me know how can I ensure that images I'm getting from Contentful cloudfront are gzip encoded?
there is no need for GZIP compression on images. GZIP and other compression algorithms only make sense for text-based formats. Images (and other binary formats) rely on different compression algorithms.
You can find more information here: https://webmasters.stackexchange.com/questions/8382/is-gzipping-images-worth-it-for-a-small-size-reduction-but-overhead-compressing
Hope that helps. :)
I've been tasked to look into Gzip compression. I've figured out so far that is not just generally accepted, but also pretty common. Now my question is how does Gzip compression influence the crawlers that visit my page?
What should I keep in mind when I decide to Gzip my page?
Will my SEO suffer from this in any way?
In short, compression: How to do it the right way?
Gzipping should not affect how crawlers look at the page. Google even suggests compressing the content, so there should not be any problem in using gzipped contents. In fact it should help in your page ranking. Most of the modern browsers supports Gzipped contents and request them in accept-headers. There are certain things you need to do like minifying of js and css before doing gzipping and there are plenty of good articles about what needs to be done. It also depends on your capability of your system environment.
Caution: There might be few region specific crawlers which may not support them, but most of the major ones do.
I have a problem with ckeditor (http://ckeditor.com/) after installing it I load it's javascript file. It seems that the file is too large (about 350 kb) and easyphp changes its mime type to text/plain for no reason and loads the contents of the .js in the wrong way.
I have tested and also a html page if it exceeds 360 kb is loaded as text/plain and html code is not interpreted.
Why if a file is too large is loaded as text/plain? How can I solve this problem?
When using CSS3 and custom fonts, the client needs to download .oft or .ttf files. These files can be >50K. Can these files be compressed? How? Assuming Apache web server.
I am looking for a compression technique or an Apache configuration. Any ideas will help because downloading +50K files should be prevented.
.ttf files compress quite well (analysis with hex editor shows a lot of 0x00's and simple zipping reduces their size to 50% or even less of original size - at least fonts I checked), so I think any compression script would do the trick and I think same rule applies oft files as well.