Php Tutorial: how to disable image caching

Source: Internet
Author: User
Images are cached on many WEB applications, such as background images and website Article thumbnails. In this way, the website data can be accessed more quickly during the next loading. However, in some special cases, we disable the browser from storing images in the cache: it may be based on security considerations, or it may be based on differences.

Images are cached on many WEB applications, such as background images and website Article thumbnails. In this way, the website data can be accessed more quickly during the next loading. However, in some special cases, we disable the browser from storing images in the cache: it may be based on security considerations, or it may be based on differences.

Images are cached on many WEB applications, such as background images and website Article thumbnails. In this way, the website data can be accessed more quickly during the next loading. However, in some special cases, we disable the browser from storing images in the cache: This may be based on security considerations, or on differentiation reasons, of course it may be another reason. This is because the method to disable caching is a little too simple.

The Code is as follows:
? "? /> ??

Actually, the h parameter can be changed. Disabling image caching is actually to make the h value when the image is loaded at this time different from the h value when the image is loaded at the next time. It depends on how you write the parameter that follows the change. Here we use the MD5 encrypted value of the current Unix Timestamp and the number of microseconds !!

Statement: This article uses BY-NC-SA protocol for authorization | IT passers-
Reprinted please note

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.