I noticed, that when we request a static resource, i.e. like this: GET /MYAPP/css/navbar.css
it appears in apache logs as two lines:
[20/Jul/2015:11:39:07 -0400] 10.72.123.1 TLSv1 AES256-SHA "GET /MYAPP/css/navbar.css HTTP/1.1" 302 224 0/159
[20/Jul/2015:11:39:07 -0400] 10.72.123.1 TLSv1 AES256-SHA "GET /css/navbar.css HTTP/1.1" 200 2846 0/364
This is something to do with a current rewrite rule set up in the configs:
RewriteRule ^/MYAPP/css/(.*)$ https://%{SERVER_NAME}/css/$1
...
<Directory "/var/www/myapp-static">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Am I right that's something is wrong here? Each request to a static file results in two calls instead of one, does it decrease the apache overall perforamnce in any way? Whats the best practice to handle this? As one of the solutions I see we can use links to static resources as /css/navbar.css directly, not via /MYAPP/css/navbar.css. But this will fail the application if it runs with no apache (as we do have some environments having no apache in it). Whats the best and typical solution is here?