Skip to content

Instantly share code, notes, and snippets.

@CodeBrauer
Last active August 29, 2015 13:57
Show Gist options
  • Save CodeBrauer/9569435 to your computer and use it in GitHub Desktop.
Save CodeBrauer/9569435 to your computer and use it in GitHub Desktop.
Don't Cache Images - PHP Solution
<!-- 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.
@CodeBrauer
Copy link
Author

Browsers will load the second image new, because they didn't found a cache version with the same filename. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment