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

Remove cached images (by API/manual) #14

Open
kleisauke opened this issue Feb 12, 2017 · 10 comments
Open

Remove cached images (by API/manual) #14

kleisauke opened this issue Feb 12, 2017 · 10 comments

Comments

@kleisauke
Copy link
Member

@kleisauke kleisauke commented Feb 12, 2017

Remove cached images (by API/manual) [15774949]

Submitted by Eugene Huseynov on 23-8-2016 0:00:00
24 votes on UserVoice prior to migration

Given

Image source (url parametre) is: https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=2048x350&scale=2&maptype=roadmap&zoom=13&markers=color:blue|size:small|1400+Oakton+Street,+Evanston,+IL+60202

Encoded version: maps.googleapis.com%2Fmaps%2Fapi%2Fstaticmap%3Fsensor%3Dfalse%26size%3D2048x350%26scale%3D2%26maptype%3Droadmap%26zoom%3D13%26markers%3Dcolor%3Ablue%257Csize%3Asmall%257C1400%2BOakton%2BStreet%2C%2BEvanston%2C%2BIL%2B60202

I'm using following images.weserv.nl parameters: &w=70&t=square&h=70
Final link: http://images.weserv.nl/?url=maps.googleapis.com%2Fmaps%2Fapi%2Fstaticmap%3Fsensor%3Dfalse%26size%3D2048x350%26scale%3D2%26maptype%3Droadmap%26zoom%3D13%26markers%3Dcolor%3Ablue%257Csize%3Asmall%257C1400%2BOakton%2BStreet%2C%2BEvanston%2C%2BIL%2B60202&w=70&t=square&h=70

Issue

Some of the "google map images" cached properly, some of them is not (link provided above - final link)
Looks like when caching process is broken by any internal reason, the "image url" is still remembered as a key in your collection. So there is no way to rebuild correct cache for that "broken" image.

Question

Is any api/way to expire/delete/rebuild/invalidate existing image cache?

Response

by Andries Louw Wolthuizen on 23-8-2016 0:00:00

Need to check if there is a reliable way to remove images from all caches. Will look into this!

Comments

Comment by Eugene Huseynov on 30-8-2016 22:39:00

Hi Andries.

I appreciate for your time and energy you spend for this project.

Any luck to fix such king issues or may be add an API for the project so customers could reset/update/delete cached images themself?

Thank you one more time.

Eugene

Comment by Andries Louw Wolthuizen (Webmaster, Images.weserv.nl - Image cache & resize proxy) on 1-9-2016 18:53:00

Hi Eugene,

This project didn't start with the intent of providing access to reset/update/delete images. To serve all users, there are caches at multiple levels involved (edge, processing, backplanes, requesters). The difficulty is that not all of these caches are capable of reliable removing single entries, and the freshness is also varying wildly (based on effort to recreate, the number of requests, etc, etc).

However, the feature as proposed is still on the roadmap, and will probably be implemented in the next code-refresh. When this will be finished is uncertain, as many new features and changes are to be incorporated in such an update.

In the meanwhile, you could consider using our code to set up your own solution. The GitHub-repo is sans any cache, so you should extent it with your own caching solution, or disregard it completly. For starters I would advise some form of reverse caching proxy (like nginx).

--
Andries

Original UserVoice Submission

@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Feb 12, 2017

See #74

Loading

@andrieslouw andrieslouw self-assigned this Mar 28, 2017
@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Mar 28, 2017

This feature is planned, but it needs additional code to delete images from the different caches. Currently it isn’t exactly clear when this will be implemented. I will update this idea when I have more info.

Loading

@tomaskazatel
Copy link

@tomaskazatel tomaskazatel commented Nov 20, 2017

Hello @andrieslouw we use your image cache service. And now we have problem with not supported removing image cache. Do you have some update for it?

Loading

@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Nov 20, 2017

There is no update yet, implementation is quite difficult. We have some code laying around to remove images from 1 or 2 cache-levels, but not yet from every cache (we cache on ~4 different levels nowadays), and this code isn't reliable enough for production yet. You could use the source-code to host your own image proxy, caching is something that isn't included in the source (we cache by means of 2x Nginx+Memcached+Squid).

Loading

@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Jun 16, 2018

Small update; there is some redesigning of the back-end of the public images.weserv.nl service going on, to remove some of the caching levels. When finished, this may open the road to reliable on-demand removal from cache. We will keep you updated.

Loading

andrieslouw added a commit that referenced this issue Sep 24, 2018
First Proof-of-Concept for front-end for Cache Removal Tool ( #14 , #159 , #74 )
@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Sep 30, 2018

Work has started in the 4.x-crt branch. Caching has been reduced to 2 levels, API for global cache still needs to be written. Proof of Concept is live on: https://images.weserv.nl/crt/

Loading

@DaanEasyAds
Copy link

@DaanEasyAds DaanEasyAds commented Mar 1, 2019

Loading

@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Mar 10, 2019

@DaanEasyAds : If you're still experiencing issues with your specific URL, please create a new issue, as comments on features are not monitored every day. The Proof of Concept only removes from local cache, global is still not written.

Loading

@andrieslouw
Copy link
Member

@andrieslouw andrieslouw commented Jun 30, 2019

Due to #186 it may seem that we cache longer; but there is no change in the amount of time we cache server side. Finishing this feature is still on our roadmap, and work is ongoing, but we need to write additional API's for all the different layers of caching we use.

Loading

@3cstudio
Copy link

@3cstudio 3cstudio commented Nov 9, 2021

@andrieslouw where does this topic of clearing image cache stand? I had a client using a WordPress Plugin (Podcast Feed Player Widget and Shortcode) that shows image thumbnails for a podcast preview "cover" image via Weserv, but he was uploading large PNG files (!). Thus, he quickly "outgrew" his allotted space, I'm guessing. :-o Only the Alt tag text was showing in place of the thumbnails. We have since revamped/resized all those images, but now would love to clear the cached giant PNG files that Weserv may have on file still... Love the service! Just can't continue to use it in its present state of not allowing for cache clearing. :-/ Thoughts? Ideas? Thanks for all you do. -Steve

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants