I am trying to optimize my website by reducing CSS, JS, SVG and Whitenet.
Although it interferes with my codebase and I want to keep the original files all around I have any To improve it, I was thinking that I can set nginx automatically serves the minimum versions of files when request for non-mined files This is what I mean to extend some pseudo-configurations: But I have no indication how to get In addition, if you think that this approach is really bad, please tell me why show me some more options! It is quite easy to use the regex variable: css | Js | Svg to
min.css | Min.js | Git is set to min.svg to self-verbally, but I have every php or HTML file which is
.min links to these files to use extensions.
try_files Using instructions and using non-micrified files as backups, if they are not present.
location. (CSS | JS | SVG) {try_files $ minified_uri $ uri; }
$ minified_uri here (like
/some/style.min.css
/some/style.css is requested when it is served).
Place ~ ^ (. +) \. (CSS | JS | SVG) $ {try_files $ 1.min $ 2 $ uri = 404; }
No comments:
Post a Comment