How To Enable Gzip Compression And Leverage Browser Caching In Pinterest, Twitter And Facebook Javascript Files.
Solution 1:
Unfortunately you cannot gzip external sources. Unless you have code on your website that actually points to those js/css files, you can't do anything with them. If they point to those files, you could do the following instead:
- Copy them over to your server and change your code, so they point to your server.
- Create a cronjob on your server that checks for any changes in those external files. If there are differences, copy them over to your server.
Solution 2:
What do you mean with "how to request these companies to make these files Gziped and have them cached."?
While it's better to serve them GZipped you shouldn't take it as a rule. I'm sure there is a greater reason to them serve it as it is than your achievement of higher rate on GTMetrix. Perhaps, they prefer use a more bandwidth of their high quality servers to minimize users use of CPU by decompressing their files. Perhaps your resources are images and GTMetrix is not dealing proper with it to make an useful suggestion (GZip images is redundant and a backfire).
Despite the obvious fact that you have no control on header properties of external files, an attempt to workaround that could cause cache problems, leading to greater problem than just a performance issue. And I'm sure these external resources by big companies are hit in a very low latency.
Post a Comment for "How To Enable Gzip Compression And Leverage Browser Caching In Pinterest, Twitter And Facebook Javascript Files."