I am new at using GZIP.
I'm using a Wordpress plugin that GZIP the website but I ran the Google Speed test and it says that the website is not gzipping bootstrap .less files and the javascript files that I call.
I'm not sure how to call a gzip or even making one, can somebody help me?
Javascript should be served minified and after minification both JS and CSS should be served compressed. Have a look at How to 'minify' Javascript code
If you are using apache 2.* as your web server you could enable mod_deflate. You can then configure the module to compress .less and any other static content you want to compress.
Here is a link to the documentation for the module: http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
Related
I am working on application that loads about same 10 js on each page. This makes the website performance too slow. Is there a way I can changes the configuration in Apache, so that I can have all my js loaded in Cache on the home page itself.
No, each resource - images, css, js, etc. - is loaded by Apache individually.
The way around this is to minify (compress) your JS into one file using a tool. But, you'll have to rewrite your HTML pages to point to the new compressed file.
It is my first time I want to enable jQuery, Javascript and CSS files compression
but I don't exactly know where to start I searched the net but there was not a detailed
example that I could implement that in my project.
Please Help me that how can I enable jQuery, Javascript and CSS files compressions?
1-In windows servers?
2-In Appache Servers?
also can I enable it through .htaccess files?
You can use the following:
http://www.jsmini.com/
Google released Closure Compiler which seems to be generating the smallest files:
https://code.google.com/p/closure-compiler/
or
http://yuilibrary.com/download/#yuicompressor
Use Yahoo compressor here is the link: http://yui.github.io/yuicompressor/
for compressing your web pages javascript or jQuery files
or use this JASOB here is the link: http://www.jasob.com/
IE8 or older automatically uses flash fallback player but the player is hosted in CDN.
I want to use hosted video-js.swf file in my server instead of CDN contents.
Because CDN swf file is not secured.
The Video.js version is 3.2, that is currently you can download from http://videojs.com/.
I tried this code but it does not work.
Can someone help me with the solution?
Thanks!
Using the link, I was able to find a swf file listed in one of the links:
http://vjs.zencdn.net/c/video-js.swf
I'm wokring on a small website that I wouldlike to use Less CSS with, but I am having trouble getting the .less file to become available. If I go to the path on the server that the .less file is at through ftp, the file is there in the browser and I can read it. However, tag in the html is bringing me to a 404 page. If I manually type in the location through http it does not work. Why might this be happening?
Requests for static files return 404 error (IIS 6.0)
Im not sure if i understood you correct, but: LESS is not a replacement for CSS. You must generate a CSS-file from your LESS-file to be able to serve it to the browser.
The reason why you cant view it in your browser is because the web server har no MIME-type for LESS-files, and it shouldnt have.
You can however view it through FTP cause its a "normal" text document.
Edit: You can also process the .less-file with javascript, but thats not recommended for production use...
I'm developing a website, I'm using gzip.exe to pre-compress css and js files (it's only 1 css file that went from 4.53 KB to 1.50 KB, and a js file containing the jquery and some scripts that went from 72.8 KB to 24.7 KB)
these files are style.gz and js.gz and served as static files.
The problem is that they don't work with Safari (v5.0.2) not the css neither the js.
the work fine for these browsers:
Firefox 3.6.10 / Google Chrome 6.0.4... / IE 8 x64 / Flock 3.0.6 / Maxthon 2.5.15... / Avant Browser 2010
All of them work fine except Safari
I'm using Windows 7 x64
You should get the server to gzip them - this can be done in the htaccess file and works just fine.
+1 What rob said.
What you're doing is a hack that is not supposed to work, so you can't really complain when it fails. Serving a gzip resource is completely different to serving a resource with a different type using a Content-Encoding header to compress it on the wire.
Serving pre-gzipped files will obviously also fail for user agents that don't understand gzip. The HTTP standard provides a mechanism for negotiating this: Accept-Encoding and Content-Encoding. Unless you re-implement that mechanism in a complete, standard-compliant way (and the article in Michael's link doesn't begin to get that right), you're blocking clients.
This is all unnecessary. Gzip is fast and servers typically cache the compressed version of static content so you gain nothing by trying to second-guess it. HTTP compression is part of the web server's core competency, let the web server do its job and leave gzip alone.
There is a way around this issue. Basically, you need to use .jgz instead of .gz as the extension for JavaScript files:
Fix for .gz and Safari