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

Duplicate detection sometimes requires a cache purge #37

Open
cameron1729 opened this issue Mar 11, 2022 · 2 comments
Open

Duplicate detection sometimes requires a cache purge #37

cameron1729 opened this issue Mar 11, 2022 · 2 comments

Comments

@cameron1729
Copy link
Contributor

cameron1729 commented Mar 11, 2022

Set up the plugin with the min duplicates = 2

Upload two identical images with a width of less than 480 (the default width to trigger a resize) in to a course. If you look at the image sources, imageopt won't have processed them.

Purging caches causes everything to start working, so it should be a problem with the image not being added to the public files cache when it's first uploaded, then when the second one is uploaded, the image is still considered not public because it's not in the cache.

We need to figure out a way to invalidate the cache when the image is uploaded the second time.

@brendanheywood
Copy link
Collaborator

I'm not super fussed by this bug. In practice we will want to set the min fairly high, say 20 or even higher. And this will be very slow moving data so it's not the end of the world if it doesn't get a proper hit for a week and then we get it for free after a security patch or some unrelated cache purge.

@gthomas2
Copy link
Owner

One fix would be to invalidate the cache every time an image file was uploaded by using a file hook.
There could be some edge cases where this might affect performance though - we'd need to think about it carefully.

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

3 participants