[GH-ISSUE #265] cache refresh #123

Closed
opened 2026-02-25 22:34:24 +03:00 by kerem · 4 comments
Owner

Originally created by @rafipiccolo on GitHub (Dec 14, 2020).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/265

What is the right way to deal with cache refresh ?

If i call this, it works, i get the image : https://www.myservice.io/upload/w_333,h_333,q_90/https://xxx/profile.jpg

But on my website, when a user uploads a new profile picture it just overwrites the one i already have.
And then if i call this same url i still get the old image, althougth the file has changed.

How can i get the new image to be generated ?

  1. never overwrite files. (forces rework in my websites)
  2. forcing a call to generate the new image when the user uploads the image ? (i'd rather not because lazy loading is usually better)
  3. adding an image hash in the url like so. This way every image has its own cache on flyimg's side (its annoying to generate the hash on evey upload)
    https://www.myservice.io/upload/w_333,h_333,q_90/https://xxx/profile.jpg?hash=xxxx
  4. specifying the file date as another parameter so that, if the date of the current file in flyimg cache is older than the one in parameter it needs a refresh.
  5. flyimg could do a HEAD request to see if the file has a new date.

all of these methods work i guess, but the 1/4/5 should be the more efficient right ?

Originally created by @rafipiccolo on GitHub (Dec 14, 2020). Original GitHub issue: https://github.com/flyimg/flyimg/issues/265 What is the right way to deal with cache refresh ? If i call this, it works, i get the image : https://www.myservice.io/upload/w_333,h_333,q_90/https://xxx/profile.jpg But on my website, when a user uploads a new profile picture it just overwrites the one i already have. And then if i call this same url i still get the old image, althougth the file has changed. How can i get the new image to be generated ? 1) never overwrite files. (forces rework in my websites) 2) forcing a call to generate the new image when the user uploads the image ? (i'd rather not because lazy loading is usually better) 3) adding an image hash in the url like so. This way every image has its own cache on flyimg's side (its annoying to generate the hash on evey upload) https://www.myservice.io/upload/w_333,h_333,q_90/https://xxx/profile.jpg?hash=xxxx 4) specifying the file date as another parameter so that, if the date of the current file in flyimg cache is older than the one in parameter it needs a refresh. 5) flyimg could do a HEAD request to see if the file has a new date. all of these methods work i guess, but the 1/4/5 should be the more efficient right ?
kerem closed this issue 2026-02-25 22:34:24 +03:00
Author
Owner

@rafipiccolo commented on GitHub (Dec 14, 2020):

maybe related to #261

<!-- gh-comment-id:744373699 --> @rafipiccolo commented on GitHub (Dec 14, 2020): maybe related to #261
Author
Owner

@sadok-f commented on GitHub (Dec 14, 2020):

@rafipiccolo Thank you for submitting this issue.

I didn't work in Flyimg code base for a while, I need to get a closer look into it and check if I can add those options: Last-Modified and ETag

There's a refresh option to reload the image from the source again r_1 you add it to your url :
https://www.myservice.io/upload/w_333,h_333,q_90,r_1/https://xxx/profile.jpg

<!-- gh-comment-id:744387698 --> @sadok-f commented on GitHub (Dec 14, 2020): @rafipiccolo Thank you for submitting this issue. I didn't work in Flyimg code base for a while, I need to get a closer look into it and check if I can add those options: `Last-Modified` and `ETag` There's a refresh option to reload the image from the source again `r_1` you add it to your url : https://www.myservice.io/upload/w_333,h_333,q_90,r_1/https://xxx/profile.jpg
Author
Owner

@sadok-f commented on GitHub (Dec 28, 2020):

@rafipiccolo sorry I was referring to rf_1 option to refresh the original image.
r option for rotating image 😄

<!-- gh-comment-id:751710067 --> @sadok-f commented on GitHub (Dec 28, 2020): @rafipiccolo sorry I was referring to `rf_1` option to refresh the original image. `r` option for rotating image 😄
Author
Owner

@sadok-f commented on GitHub (Oct 23, 2023):

Hi @rafipiccolo
I'm wondering if you still use Flyimg in your company/organisation ?
If so, it would be great if you could add your entry here in the Adoperts file
https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md
many thanks!

<!-- gh-comment-id:1774708604 --> @sadok-f commented on GitHub (Oct 23, 2023): Hi @rafipiccolo I'm wondering if you still use Flyimg in your company/organisation ? If so, it would be great if you could add your entry here in the Adoperts file https://github.com/flyimg/flyimg/blob/main/ADOPTERS.md many thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#123
No description provided.