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?