Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Cache base64 encoded images in modern browser Local Storage with this jQuery plugin.

branch: master

Merge pull request #1 from MarkVaughn/patch-1

for matching example.png.JPG as jpeg
latest commit dd3142a7a4
Dumitru Glavan authored October 26, 2011
Octocat-spinner-32 assets Update assets/jquery.imageCache.js October 26, 2011
Octocat-spinner-32 README Docs changed March 08, 2011
Octocat-spinner-32 demo.html Prevent multiple request for the same image March 25, 2011
Octocat-spinner-32 get_image.php Docs February 23, 2011
README
jQuery Image Cache Plugin

Cache base64 encoded images in modern browser Local Storage with this jQuery plugin.

Set up get_image.php to return base64 encoded content from the server.

<ul>
  <li><img src="assets/test-image-1.jpg" class="imageCache" /></li>
  <li><img src="assets/test-image-2.jpg" class="imageCache" /></li>
  <li><img src="assets/test-image-4.jpg" class="imageCache" /></li>
  <li><img src="assets/test-image-5.jpg" class="imageCache" /></li>
</ul>

Or you can ommit the SRC attribute and store it in data-src, because some browseres still request the server to see if the image is not changed:

<ul>
  <li><img src="" data-src="assets/test-image-4.jpg" class="imageCache" /></li>
  <li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
</ul>

<script type="text/javascript">
	$('img.imageCache').imageCache();
</script>
Something went wrong with that request. Please try again.