2

I ran my website through Google's Page Speed Insights and compressing my javascript files is apparently a priority. I am hosting on Go Daddy and am not sure if it is enabled, so I would like to find an alternative.

I came across a blog post stating that you could compress the files locally on the command line with gzip file.js. But then how does the browser reference and unzip these files? It would be great to get a step by step process. An example of a file that would need to be compressed would be http://mydomain.es/jquery-ui.js.

In other words, once I have compressed jquery-ui.js.gz what do I do with it? Okay, I upload it to the server, but then what? Do I refer to it in my html as <script src="jquery-ui.min.js.gz"></script> How does the browser know to unzip it and where to find it?

Eric Brotto
  • 53,471
  • 32
  • 129
  • 174
  • This can help, if you are running Apache: http://stackoverflow.com/questions/9076752/how-to-force-apache-to-use-manually-pre-compressed-gz-file-of-css-and-js-files – Andrea Parodi Feb 01 '14 at 22:02
  • This is the answer you are looking for: http://stackoverflow.com/a/212684/79485 – Marcel Oct 30 '14 at 08:32
  • However, actually, what is an alternative to compressing files for you when you do "local compress"? You should change the title of the question, probably. – Marcel Oct 30 '14 at 08:33

0 Answers0