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

Clear cache strategy to delete generated files when settings changed etc. #10

Open
moltar opened this issue Oct 13, 2018 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@moltar
Copy link

moltar commented Oct 13, 2018

When image style settings (imageStyles) are adjusted after an image was generated, the changes are not reflected and a rendered image is served.

Specifically, I changed from a macro to actions and changed the dimensions of the image.

Clearing the static/image-styles dir manually solves the problem of images being cached.

@Barry-Fisher
Copy link
Contributor

Hi @moltar,

Thanks for your feedback. Yes, to clear the cache it's currently the case that you need to delete the generated images. This is (kind of) by design, although I did think it might be nice to have a flush images command that could be run. I got torn between a few ideas on the best way to implement this for a user experience point of view.

Do you have any particular thoughts or ideas you'd like to share on how you'd like to clear the cache? A command? An HTTP endpoint that clears the cache? Something else?

Thanks,

Barry

@Barry-Fisher Barry-Fisher added the enhancement New feature or request label Nov 5, 2018
@Barry-Fisher Barry-Fisher changed the title Bug: cache is not cleared when image style settings are changed. Clear cache strategy to delete generated files when settings changed etc. Nov 5, 2018
@moltar
Copy link
Author

moltar commented Nov 5, 2018

I think the image filename should contain the hash of the variables that went into creating it. So when these variables change, the hash changes and the images are automatically invalidated and created a-new.

@moltar
Copy link
Author

moltar commented Feb 27, 2019

Another option is to just use rimraf and clear the static/image-styles dir.

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

No branches or pull requests

2 participants