Reputation: 14990
I´ve got this site build in Drupal. This is not a Drupal related question. I´m trying to speed up the load time, so I´ve made a test using Google Page Speed script. The thing is that the biggest issue is compressing some files. As I´ve got several "speed up" modules in my Drupal installation, these "uncompressed" files are not Drupal but third party related. They are, in example, my counter image and a js file from a video player:
Si se comprime http://www.mysite.org/jwplayer/jwplayer.js ...
Si se comprime http://www.w3counter.com/tracker.js ...
How do I compress those files? Should I just put them inside a zip in point to a zipped file? But would those files work as expected? I mean, Pointing to a zipped .js file, or zipping the counter´s tracker?
I have no idea on what to do about those errors. I haven´t found a newbie explanation yet about how to compress and point to a compressed yet working file online.
Thanks!
Rosamunda
Upvotes: 1
Views: 485
Reputation: 29649
As Dmitry Leskov says - switching on your web servers automatic compression module will compress everything served from your box (the jwplayer, in this instance), though it won't compress resources pulled from outside your server (w3counter.com).
If your site is slow, it may not be because of "front-end" issues (which you get from the PageSpeed script), but because your "back-end" is slow, e.g. the database, or the Drupal engine itself; if it takes 5 seconds for your page to be generated, no matter how well-compressed your JavaScript, the site's always going to feel slow. Even more so because JavaScript resources are often cached on the browser...
It's worth looking at both parts of the jigsaw. A quick and dirty way to find out what's going on is to use the Firebug plug-in to see how long it takes for your server to respond to requests.
Upvotes: 0
Reputation: 3165
The web server can compress files before serving them to the browser. If you are using a recent version of Apache, enabling the module mod_deflate may be enough. (At least I did not do anything else and Firebug shows Content-Encoding: gzip
for all HTML/CSS/JS requests and Page Speed gives it thumbs up.)
Upvotes: 2