Load javascript gz file

435 Views Asked by At

I have used grunt require plugin to concat and minify all my JavaScript modules into a single JavaScript file. Now, i have compress the same as g zip. How can i load compressed file using require ? The advantage is size of the compressed file which has been reduced from 82kb to 27kb.

1

There are 1 best solutions below

0
bmanvelyan On

You don't make a compress a script with gzip and ungzip it manually, you have to configure your web server compress it on the fly before sending it to the client. There is no deatils what web server you are using, but instructions for apache HTTP are very straightforward.