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

Thumbnail cache is not cleared when replacing image with the same filename #87

Open
travisbotello opened this issue Mar 16, 2020 · 8 comments

Comments

@travisbotello
Copy link

travisbotello commented Mar 16, 2020

When replacing an existing Image+ image file with a new image using the same file name the phpthumb in the backend is not showing the new image.

How to reproduce

  1. Create a TV using image+
  2. Set an image in the image+ TV, crop it and save the resource
  3. Upload a new image with exactly the same filename (you can remove the previous image) and set it in the image+ TV
    => preview area is still showing the first image

Problem seems to be in the used image src: /connectors/system/phpthumb.php?wctx=mgr&w=400&source=2&src=categories%2Fhome-600x510px.png&sw=600&sh=510&sx=0&sy=0

@Jako Jako added the bug label Mar 17, 2020
@Jako
Copy link
Owner

Jako commented Mar 17, 2020

Thats an issue of the phpthumb connector and maybe can't be solved inside of Image+. I will look for this.

@travisbotello
Copy link
Author

Interesting...thanks for the update!

@Jako
Copy link
Owner

Jako commented Mar 21, 2020

Could you try to attach a random url parameter, to look wether this forces a reload of the thumbnail (then it is a browser caching issue)? If not, this can't be solved in Image+ and (maybe) not with the default phpthumb connector.

@travisbotello
Copy link
Author

Just tried that. Attaching &v=1 to the filename refreshes the thumbnail correctly.

<img src="/connectors/system/phpthumb.php?wctx=mgr&amp;w=400&amp;source=2&amp;src=categories%2F40x40.png&amp;v=1&amp;sw=640&amp;sh=425&amp;sx=0&amp;sy=0" id="ext-comp-1035">

@Jako
Copy link
Owner

Jako commented Mar 22, 2020

Then it is maybe just a browser caching issue. This could be solved by Image+ and other extras with a parameter hash including the file date/size.

@travisbotello
Copy link
Author

That makes sense. Currently I set filesluggy to automatically add unique hash to any uploaded file which is basically having the same effect.

@Jako
Copy link
Owner

Jako commented Mar 22, 2020

But then you maybe have a lot of duplicated files.

@travisbotello
Copy link
Author

True, that is not ideal. But currently my clients prefer that options so they don't have any issues with caching when replacing images with the same file name...

@Jako Jako added enhancement and removed bug labels Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants