After the uploaded avatar is changed, the old Avatar will still be displayed in the cache. How can this problem be solved?

Source: Internet
Author: User
PHP + HTML will overwrite the original Avatar After the Avatar is uploaded. For cache reasons, only CTRL + F5 is refreshed. Otherwise, the old Avatar will always be displayed. How can you solve this problem? PHP + HTML

After an avatar is uploaded, it will overwrite the original avatar. For cache reasons, it will only be displayed after CTRL + F5 is refreshed. Otherwise, the old Avatar will always be displayed.

How do you solve this problem?

Reply content:

PHP + HTML

After an avatar is uploaded, it will overwrite the original avatar. For cache reasons, it will only be displayed after CTRL + F5 is refreshed. Otherwise, the old Avatar will always be displayed.

How do you solve this problem?

It is best to modify the Avatar url after the avatar changes.

If you want the url to remain unchanged, remember to include? R = xxxRemember thisXxxRandomly generated by the server or client each time.

Another method is to use a fixed url for a user's profile picture, such as facebook. However, when accessing this url, a 302 jump will be generated to the real image address, the actual image address ensures that each avatar is different.

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.