If the image on qiniu uses the suffix of the version number, can the image of the old version be automatically overwritten?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.