.htaccess 用于压缩、浏览器缓存、代理缓存等

发布于 2024-08-29 06:11:16 字数 100 浏览 3 评论 0原文

有人可以为我提供一个优化 .htaccess 配置来处理典型网站的压缩、浏览器缓存、代理缓存等吗?

除了我的访客之外,我还努力让 Google PageSpeed 满意。

Can someone provide me with an optimize .htaccess configuration that handles compression, browser caching, proxy caching, etc. for a typical website?

Aside from my visitors, I'm also trying to make Google PageSpeed happy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉世弥音 2024-09-05 06:11:16

我在 yslow_optimizations.conf 文件中有以下内容,我将其包含到我的 apache conf 文件中,我认为它们在 .htaccess 文件中也应该可以正常工作:

# disable ETags                                                                            
FileETag none                                                                                       

# GZip css, js                                                                                      
AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript              

# set expires into the future                                                                       
ExpiresActive on                                                                                    
ExpiresDefault "access plus 1 month"                                                                

我确信还有更多内容可以添加到其中,但这只是一个开始。

I have the following in a yslow_optimizations.conf file I include into my apache conf files, I think they should work Ok in an .htaccess file too:

# disable ETags                                                                            
FileETag none                                                                                       

# GZip css, js                                                                                      
AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript              

# set expires into the future                                                                       
ExpiresActive on                                                                                    
ExpiresDefault "access plus 1 month"                                                                

There's more that could be added to it I'm sure, but it's a start.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文