Sam
Sam

Reputation: 15508

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. Some questions though:

Q1) does it matter where (top or bottom of htacces) these three lines go?

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?

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?

Upvotes: 3

Views: 3509

Answers (1)

cdeszaq
cdeszaq

Reputation: 31290

Q1) It only matters if there are other lines in the file that may override it. 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

Q3) Yes, it can go in there. 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

Upvotes: 2

Related Questions