zendframework/zf2-documentation — pull request #1036 by dol (2013-09-13 10:05:14+00:00)
Title: Minor fix in RewriteCond and RewriteRules to perform a faster match and fix a glitch in caching rules

If the match of '^.*$' is not used, it can be replaced with the regex
rule '^', witch means, 'match every string that starts'. This is
always the case.
This will gain some sub milliseconds performance increase because
the regex matching is faster.

Also fixed a possible glicht when looking for a cached file:
E.g.:
Old
---
RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}.(html|xml|json|opml|svg) -f

Fix
---
RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}\.(html|xml|json|opml|svg) -f

In the old version, the '.' was not escaped. This could lead to a
wrong lookup of the file, because the dot can be any character.

REQUEST_URI=glitch-json
-> %{DOCUMENT_ROOT}/cache/glitch-json as file exists, but %{DOCUMENT_ROOT}/cache/glitch.json
-> The file http://mydomain.tld/cache/glitch.json is returned, witch
ends up in a 404 error
This case is very rare, but possible.