jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Photon: add option to flush the cache for the whole site

Open nengineer opened this issue 12 years ago • 48 comments

You really need a way to clear the Photon cache for a site from within JetPack.

nengineer avatar Jul 30 '14 23:07 nengineer

I was looking for a Photon cache in Jetpack and I couldn't find it. The only information I could find on clearing Photon caching is this text from the Photon developer page - "No cache invalidations – currently the images are cached “forever”. If you want to “refresh” an image you will need to change the name of the image. Adding random query arguments, commonly known as cachebusters, will not work." That text appears on the Jetpack Photon page, as well.

Is there another layer of caching in Jetpack that I missed, or is the only layer of caching the Photon service itself?

enkrates avatar Aug 06 '14 20:08 enkrates

The only layer is Photon itself, so that documentation applies to Jetpack.

kraftbj avatar Aug 06 '14 20:08 kraftbj

So, is this issue applicable to Jetpack? Is there such a thing as "clear the Photon cache"?

enkrates avatar Aug 06 '14 20:08 enkrates

The request is, basically, create a way to clear the Photon cache via Jetpack. It isn't an option anywhere currently nor a quick enhancement. Will require working with the WP.com Systems folks to add invalidation to Photon I'd be expect.

kraftbj avatar Aug 06 '14 20:08 kraftbj

@kraftbj That makes sense, thanks for walking me through it.

enkrates avatar Aug 06 '14 20:08 enkrates

We're currently reworking a lot of the backend of the Photon CDN to stabilize it and migrate some of the servers, so this may become much more feasible in the near future. Also, adding automated purging of images when an image is deleted locally via the wp admin.

georgestephanis avatar Oct 09 '14 18:10 georgestephanis

Any updates?

XPMai avatar Jul 16 '15 16:07 XPMai

@maivutan We'll post here as soon as we make progress on this.

jeherve avatar Jul 17 '15 11:07 jeherve

Any updates on this? Considering adding to a large site. Thanks!

rdreessen avatar Aug 11 '15 18:08 rdreessen

@rdreessen As stated above, we'll post here when there are updates. Thanks!

kraftbj avatar Aug 12 '15 02:08 kraftbj

Also requested here: https://wordpress.org/support/topic/jetpack-and-ewww-image-optimizer-images-problem?replies=6&view=all#post-7335364

jeherve avatar Aug 23 '15 12:08 jeherve

Asked our systems team about the technical limitations around this so that we can decide how to handle

samhotchkiss avatar Aug 29 '15 16:08 samhotchkiss

Based on the technical limitations of our CDN, there isn't a way to do this on a site-wide basis at this time.

samhotchkiss avatar Aug 29 '15 16:08 samhotchkiss

So, it has taken you over a year to figure this out?

nengineer avatar Aug 30 '15 01:08 nengineer

Why you can do this manually but the site-wide?

XPMai avatar Aug 30 '15 08:08 XPMai

So, it has taken you over a year to figure this out?

We left it open in hope the technical limitations would change, but we've opted to close the issue at this time until such a time the infrastructure would make this feasible. In short, it didn't take us a year to determine the limitation, but a year to decide to not leave it open pending something outside our team's scope to change.

Why you can do this manually but the site-wide?

Manually, we're able to clear out specific individual URLs. We're unable to do this en mass and it's pretty time consuming, unfortunately.

kraftbj avatar Aug 31 '15 03:08 kraftbj

Ok, so not site-wide. How about a button for each individual image in the Media library?

rothschild86 avatar May 28 '16 20:05 rothschild86

Another vote for a user-facing tool to flush Photon's cache for specific images: https://wordpress.org/support/topic/option-to-clear-image-cache?replies=1&view=all

jeherve avatar Jun 13 '16 13:06 jeherve

Also requested here: https://wordpress.org/support/topic/please-remove-all-cached-images?replies=1&view=all

jeherve avatar Jun 15 '16 11:06 jeherve

As an additional note - the goal is to make photon work with plugins such as https://wordpress.org/plugins/enable-media-replace/

As of now, an old image is being served after it has been replaced in the media library.

one idea: adding a date-modified-time-stamp to the end of photon url would tell it that the image has changed and needs to be refetched...

rothschild86 avatar Jun 17 '16 19:06 rothschild86