Why Laravel Elixir creates a file with the hashes in the public/build/assets (approximately similarly in Yii)?

For example, create using laravel-elixir file in public/assets/some.css.
This creates a copy of this file in the public/build/assets/some-filehash.css, which is called from view when you use the elixir('assets/some.css').
It is unclear what is the better option if elixir('assets/some.css') gave public/assets/some.css?v=filehash.
Approximately the same situation in Yii.
Why make copies of the files, if possible in view to add the css parameter to the cache had not taken the old version?
July 8th 19 at 11:27
2 answers
July 8th 19 at 11:29
In General, there are several benefits to separate files before adding a get parameter in 1 file:
  1. If a cached html page which is changing layout and styles, the old version will be given to the old files for the new - new. In the case of get the old layout option will give new stylesheet or js that may be incompatible with the old layout.
  2. Some proxy servers cacheroot static, not taking into account get parameters - at the moment most likely the problem is not relevant
  3. Problems when under static using a separate server due to the lack of synchronization between layout and statics
July 8th 19 at 11:31
Statics can give nginx and do it very quickly.
Ie, for nginx there is a significant difference between appeals to the file with a get parameter and without? - Brian.Jones59 commented on July 8th 19 at 11:34
I tried to test nginx to the treatment to static - the presence of a get parameter and speed is not affected. - Brian.Jones59 commented on July 8th 19 at 11:37

Find more questions by tags YiiLaravelGulp.js