[英]Proper use of Header set Connection Keep-Alive (Apache)
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
In order to make files reloading bit faster, a server needs the Keep Alive
enabled in Apache. 为了使文件重新加载更快,服务器需要在Apache中启用
Keep Alive
。 Some questions though: 但有些问题:
Q1) does it matter where (top or bottom of htacces) these three lines go? Q1)这三条线的位置(htacces的顶部或底部)是否重要?
Q2) if I omit the ifModule above and below the Header set Connection keep-alive
then it seems still to work so is it necessary / what does the ifModule do? Q2)如果我在
Header set Connection keep-alive
之上和之下省略了ifModule,那么它似乎仍然有用,所以它是必要的/ ifModule做了什么?
Q3) on the bottom of my htacces there is already a section with ifModule mod_headers.c
and all sorts of FilesMatch in there (static caching of files per filetype like css js html etc. can the Header set Connection keep-alive
go in there? Q3)在我的htacces的底部已经有一个
ifModule mod_headers.c
和各种FilesMatch的部分(每个文件类型的文件的静态缓存,如css js html等, Header set Connection keep-alive
可以进去吗?
Q1) It only matters if there are other lines in the file that may override it. Q1)只有文件中有其他行可以覆盖它才有意义。 In general, whatever comes last wins.
一般来说,无论最后胜利。
Q2) ifModule
is a basic conditional that allows you to specify configuration if the indicated module is loaded or not Q2)
ifModule
是一个基本条件,允许您在加载指示的模块时指定配置
Q3) Yes, it can go in there. Q3)是的,它可以进去。 A conditional is a conditional, so unless you have a rather complex module-dependent configuration, you will only really need one
ifModule
block for any given module in a particular file 条件是条件的,所以除非你有一个相当复杂的模块相关配置,否则你只需要一个特定文件中任何给定模块的
ifModule
块
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.