preact-cli: How to invalidate (bust) cache

I started a small SPA with preact-cli using the simple template. I’ve hosted it on Netlify, auto-building from GitHub. It’s working fine but every time I update it I have to clear the cache before seeing the changes.

I’m using preact-cli 2.1.0 and here’s my repo: https://github.com/haggen/localthreat

My users are complaining they don’t see it at all even after a page reload.

I’m new to (P)React so I might be missing something here. What can I do invalidate the assets I have online?

Thanks in advance.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Great, thanks for posting! I’m sure you’re not the first nor the last, so others will find this useful 😄

@prateekbh Thank you for your time in this matter. I actually managed just using the copy-webpack-plugin and copying the _redirects from a different directory than assets/.

I’ll just leave my two cents here and say that although preact-cli templates are wonderful for picking up, it gets in the way real quick. Mine is such a small application (2 screens, a handful of component) and I already detected a bunch of issues due to the project opaqueness. A summary of its components and their function within the context of your application – what is copied where, which files get what transformations, etc. – would come a long way.

Thanks again! o/

I found out what it was. Part my mistake, part misunderstanding. 😛 Thanks anyway!