<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?
Q1) It only matters if there are other lines in the file that may override it. In general, whatever comes last wins.
Q2)
ifModuleis a basic conditional that allows you to specify configuration if the indicated module is loaded or notQ3) 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
ifModuleblock for any given module in a particular file