如何启用gzip压缩并利用Pinterest,Twitter和Facebook Javascript文件中的浏览器缓存。 [英] How to enable gzip compression and leverage browser caching in Pinterest, Twitter and facebook Javascript files.

查看:159
本文介绍了如何启用gzip压缩并利用Pinterest,Twitter和Facebook Javascript文件中的浏览器缓存。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为性能调整的一部分,GTMetrix建议启用enable Enable gzip压缩并利用Pinterest,Twitter和facebook JS文件利用浏览器缓存。这些通常是从为其提供服务的服务器上完成的。我无法找出如何要求这些公司将这些文件压缩并缓存。
请帮助使这些文件压缩并缓存。

As part of performance tuning, GTMetrix is suggesting to enable enable Enable gzip compression and leverage browser caching with Pinterest, Twitter and facebook JS files. These are usually done from the server they are served from. I am not able to find out how to request these companies to make these files Gziped and have them cached. Please help in making these files Gziped and cached.

感谢您的帮助。

推荐答案

不幸的是,您无法gzip外部资源。除非您的网站上有指向这些js / css文件的代码,否则您将无法对其进行任何操作。如果它们指向这些文件,则可以执行以下操作:

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:


  1. 将它们复制到服务器并更改代码,以便它们指向到您的服务器。

  2. 在服务器上创建一个cronjob,以检查这些外部文件中的任何更改。如果有差异,请将它们复制到您的服务器上。

这篇关于如何启用gzip压缩并利用Pinterest,Twitter和Facebook Javascript文件中的浏览器缓存。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆