Optimize browser caching of Assets
In our webserver configuration we will activate caching. Currently, this might lead to situations, where the website and the distributed CSS or JS don't fit together anymore. This might lead to weird behavior. Typically this issue is solved by adding some hash to the filename of the generated CSS. Example: hifis.dh45js.css
. Like this, the browser definitely knows, when to load a new file.
In Jekyll there exist multiple solutions. As a beginning, I would suggest to go for the most easy to implement approach by adding the generation timestamp.
<link rel="stylesheet" href="hifis.css?{{site.time | date: '%s'}}">
Like this, the browser knows, when to load new assets. An ideal solution would be to add a hash to the file. This would probably require a plugin. One could have a look at https://github.com/envygeeks/jekyll-assets.