Last active
August 29, 2015 13:57
-
-
Save CodeBrauer/9569435 to your computer and use it in GitHub Desktop.
Don't Cache Images - PHP Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This img will be cached. --> | |
<img src="http://example.com/dynamic_image.png"> | |
<!-- This img will not be cached. --> | |
<img src="http://example.com/dynamic_image.png?x=<?php echo time(); ?>"> | |
Thats a small little hack to prevent caching images. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Browsers will load the second image new, because they didn't found a cache version with the same filename. 👍