You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the browser-sync client javascript that is served to the browser has no caching headers in the HTTP response leading the browser to not cache it upon new requests to the file.
I'm wondering why because other files served through browser sync correctly have the caching headers (specially the Cache-Control and Etag ones). I am missing something obvious here?
Here the steps to replicate (I could create a small repo if you prefer):
$ mkdir /tmp/browser-sync-client && cd /tmp/browser-sync-client
$ echo "<html>Browser Sync Caching Test</html>" > index.html
$ browser-sync start --server &
$ # You can also check in browser developer tools
$ curl -v http://localhost:3000 2>&1 | grep "Cache\|ETag" # Correct, has caching headers
$ curl -v http://localhost:3000/browser-sync/browser-sync-client.2.7.6.js 2>&1 | grep "Cache-Control\|ETag" # Incorrect, no caching headers
I'm willing to tackle this issue if you aim me in the right direction.
Regards,
Matt
The text was updated successfully, but these errors were encountered:
@maoueh we'd love to receive a contribution from you!
so it's actually an issue in the browser-sync-client library...
Browsersync retrieves the middleware via a plugin manager and then registers it with the connect middleware stack. (it does the same thing for the proxy/snippet servers too)
so basically, you can add headers to the client library here
Hi there,
It seems that the browser-sync client javascript that is served to the browser has no caching headers in the HTTP response leading the browser to not cache it upon new requests to the file.
I'm wondering why because other files served through browser sync correctly have the caching headers (specially the
Cache-Control
andEtag
ones). I am missing something obvious here?Here the steps to replicate (I could create a small repo if you prefer):
I'm willing to tackle this issue if you aim me in the right direction.
Regards,
Matt
The text was updated successfully, but these errors were encountered: