ExpiresDefault:访问和修改之间的区别?
在 Apache 的 .htaccess 中设置缓存控制时,我一直在尝试解码访问和修改之间实际的、有益的差异。 /strong>,什么时候使用which,但是发现 Apache 文档对于我的理解来说太技术性了。
基本上,我想使用一种能够提供良好快速缓存的方法。有人可以解释使用访问相对于修改的优点吗?什么时候用哪个?
A7200 是否意味着“在上次用户访问后保留 2 小时”?
ExpiresDefault "access plus 10 years"
M7200是否意味着“文件修改后在服务器上保留2小时”?
ExpiresDefault "modification plus 10 years"
我有一堆动态文件(php | htm)和一堆静态文件(ico | jpg | png | gif | svg | swf | css | js | fon | ttf | eot | xml | pdf | flv)并且无法制作我想知道该怎么做。非常感谢您的澄清。
I have been trying to decode the actual, benefitial differences between the Access and Modification, when setting Cache control in Apache's .htaccess, when to use which, but find the Apache documentation too technical for my understanding.
Basically, I want to use a method that gives me good fast caching. Can someone explain the advantages of using access as opposed to modification? When to use which?
Does A7200 mean "keep 2 hours after last user accessed it"?
ExpiresDefault "access plus 10 years"
Does M7200 mean "keep 2 hours after the file was modified on server"?
ExpiresDefault "modification plus 10 years"
I have a bunch of dynamic files (php|htm) and a bunch of static files (ico|jpg|png|gif|svg|swf|css|js|fon|ttf|eot|xml|pdf|flv) and cannot make up my mind what to do. Thanks very much for clarification.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
访问是指客户端的网络浏览器上次请求该文件的时间
修改是指网页上次更改 (HTML) 或生成 (PHP) 的时间
如果您说 Expiresdefault“访问加 2 天”,则意味着当用户从 Apache 下载文件时,该文件会在 Apache 缓存中保留 2 天除非另一个用户请求相同的文件等等...
访问加 2 天应该足够了,10 年似乎非常过多。
Access refers to the last time a client's web browser requested the file
Modification refers to the last time the webpage changed (HTML) or was generated (PHP)
If you say Expiresdefault "access plus 2 days" it means that when a user downloads a file from Apache, that file stays in the Apache cache for 2 days unless another user requests the same file and on and on...
Access plus 2 days should be good enough, 10 years seems very excessive.