amber
amber copied to clipboard
Client reload doesn't work out-the-box in Chomium
Description
Chromium Browser doesn't update the code changes in main.js
or main.scss
Steps to Reproduce
-
amber watch
- Open http://0.0.0.0:3000/ in Chromium Browser
- Change
$primary
inmain.scss
- See triggered reload in Chromium Browser
Expected behavior: color changes
Actual behavior: colors doesn't change
Reproduces how often: 100%
Versions
$ shards --version
Shards 0.10.0 (2020-05-03)
$ crystal -v
Crystal 0.35.0 (2020-06-09)
LLVM: 10.0.0
Default target: x86_64-pc-linux-gnu
$ amber --version
Amber CLI (amberframework.org) - v0.35.0
$ npm -v
6.14.5
$ node -v
v14.3.0
$ lsb_release -a
LSB Version: n/a
Distributor ID: ManjaroLinux
Description: Manjaro Linux
Release: 20.0.3
Codename: Lysia
Additional Information
The issue goes away when I check the option Disable cache (when DevTools is open)
I opened this issue to confirm Is this the right workaround or should I change some cache settings in my app?
Happy Crystalling! :heart: :sunglasses:
@faustinoaq do you think you can take a look at this?
Looks like this has to do with how Chromium and Chrome behave on 'Cache-Control' header, which is set by pipes/static.cr to private, max-age=3600.
I tried reproducing this in Chrome but Chrome for some reason doesn't cache the main.bundle.css file but Chromium caches it and is reproducible.
@eliasjpr @faustinoaq Do you think it would be a good idea to make the static response headers configurable? Would be happy to create a PR.
@midhun-at-vineti Yes lets make those headers configurable if possible have some default for Chromium
@eliasjpr on it. 👍