Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser assets cache reset #11

Open
fullofcaffeine opened this issue Jan 29, 2018 · 4 comments
Open

Browser assets cache reset #11

fullofcaffeine opened this issue Jan 29, 2018 · 4 comments

Comments

@fullofcaffeine
Copy link

Hi,

I'm experimenting with butterfly and I'm wondering how you'd deal with cleaning the browser cache when you push a new version to be served by the web server. I know there are headers that you can use and meta tags, and there's also the option of adding a unique hash to as a suffix to the assets files (middleman and jekyll have this out-of-the-box).

How do you deal with this currently for your butterfly-genereted sites?

@fullofcaffeine fullofcaffeine changed the title Assets caching reset Browser assets cache reset Jan 29, 2018
@ashes999
Copy link
Owner

Hi,

To be honest, I've never thought about or dealt with the issue. Refreshing a few times (or CTRL+SHIFT+R in Chrome) cleans the cache and shows me the updates.

Obviously, you can't tell this to consumers of your site. Unless you're publishing multiple new posts a day, I don't think this will really affect them.

One option I've seen used in the past is to append a random query string parameter to each request, eg. ?r=123281 which is generated automatically on the server-side. I don't know if that's an option worth investigating.

Headers and meta-tags might be the path of least resistance. I don't use Butterfly any more, but feel free to fork it and/or open a PR if that fits your needs.

@fullofcaffeine
Copy link
Author

Thanks for the insights. I'll probably implement some kind of asset hash.

I don't use Butterfly any more, but feel free to fork it and/or open a PR if that fits your needs.
Oh, are you using something else for your static sites/blogs?

Cheers!

@ashes999
Copy link
Owner

Oh, are you using something else for your static sites/blogs?

No, I simply haven't felt a need to blog in a long time. And my main site uses something custom (not Butterfly), because it has different requirements.

@fullofcaffeine
Copy link
Author

fullofcaffeine commented Jan 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants