Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome workspaces with fingerprinted assets

Chrome workspaces: let's say I map local CSS files to those served by my local http server. Everything works great and I can modify the files in-browser and upon page refresh my changes persist.

We happen to fingerprint our assets so that they are referenced via urls like styles.css?longuniquehash. Great practice - this way we can use aggressive caching and be sure the most recent assets will be used by the client.

However, this backfires a little with workspaces as the mappings get lost whenever the url is updated. In a nutshell: we map styles.css?123 to the local resource, we change it and on page refresh it comes back as styles.css?234 which has to be mapped again.

We're using cassette, but the problem can be reproduced on any setup with fingerprinting. Is there a setting or a workaround I'm missing?

like image 239
Oleg Avatar asked Apr 15 '14 22:04

Oleg


1 Answers

According to Chromium, the support for mapping URLs with query params (i.e. style.css?123) was only partial up until Chrome 49 - where it was removed completely.

If you can't manually remove the params from your code, a temporary workaround is to remove the ?123 param from the stylesheet reference in the Chrome inspector once the page has loaded. Then your workspace mapping and auto-refreshing should work fine until you load the page again.

You can star and follow this issue here: bugs.chromium.org

like image 63
Cody MacPixelface Avatar answered Nov 05 '22 08:11

Cody MacPixelface