Cache static resources like css, js and images for a specific time period

Sometimes we need to cache some static resources so that performance of the site can be improved over the time.

Static resources like css, js images etc. need not be reloaded from the server every time until and unless we want the old one needs to be replaced by the new one.

So here I am going to give an example how caching mechanism works in java based web application.

Create some Enums first



Now create filters


 Now put entries in web.xml file

That’s all. Thanks for your patience. Please leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.