For example, if a user's profile picture is uploaded for the first time, is the original image jpg? V1 is then automatically cached in CDN and the user updates the Avatar. The second uploaded image is jpg? V2 because of the different suffixes, after refreshing, the Avatar will be displayed as a new image. At this time, jpg? The v1 URL is still displayed in the browser. For example, if the user's profile picture is uploaded for the first time, the original image is jpg? V = 1 and then automatically cached in CDN
Then, the user updates the Avatar. The second uploaded image is jpg? V = 2 because of the different suffixes, the new image will be displayed after refreshing.
Jpg at this time? V = 1 the URL is still displayed as an old image in the browser, but after a few days, the URL is automatically changed to jpg? V = 2 new image
Is this the default function of qiniu? Or do you want to write your own code? How can images of earlier versions be automatically displayed as the latest version?
Reply content:
For example, if a user's profile picture is uploaded for the first time, is the original image jpg? V = 1 and then automatically cached in CDN
Then, the user updates the Avatar. The second uploaded image is jpg? V = 2 because of the different suffixes, the new image will be displayed after refreshing.
Jpg at this time? V = 1 the URL is still displayed as an old image in the browser, but after a few days, the URL is automatically changed to jpg? V = 2 new image
Is this the default function of qiniu? Or do you want to write your own code? How can images of earlier versions be automatically displayed as the latest version?
This is the CDN cache mechanism.
After the content of a file with the same name is modified or overwritten, CDN continues to cache the old file for a period of time.
You can use
Http: // qiniucdn/wenjianming? V = 123 adds the version number parameter to refresh the cache and access the latest resources.
After 24 hours, the cache of the file will be automatically refreshed to access the latest file:
Http: // qiniucdn/wenjianming
If you want to access the latest file, it is better to add the version number parameter after the link.