I'm wondering if there is a convenient way to disable cache for css and js. I tried to modify /usr/local/etc/nginx/valet/valet.conf and add following configuration, but it led to 404 error for all css and js files. Do I miss something? Thanks!
location ~* \.(?:css|js)$ {
expires -1;
}
I had this problem - the easiest solution was to add timestamps to files, something like this:
<script src="/js/my-script.js?{{ time() }}"></script>
<link rel="stylesheet" href="/css/style.css?{{ time() }}" />
Then the files won't cache.
@gzhihao in my case root is set to / I have changed this to my pulbic local folder and 4040 dissapears.
Most helpful comment
I had this problem - the easiest solution was to add timestamps to files, something like this:
Then the files won't cache.