Reputation: 1668
I have a JSF page with very big images - 3.4 Mb. I use this code to call the image
<div data-src="resources/images/slide1.png">
Is there any way to cache the image into client browser because every time it takes 3-4 seconds to download the picture?
Upvotes: 2
Views: 1121
Reputation: 1108642
Reference it as JSF resource. Then JSF resource handler will automatically take care of caching. Its default expiration time is configurable in web.xml
.
So instead of
<div data-src="resources/images/slide1.png">
do
<div data-src="#{resource['images/slide1.png']}">
Upvotes: 4