Easily implement page caching with spring MVC

Source: Internet
Author: User
Cache | page

Spring's MVC is a very flexible framework for seamlessly integrating struts/webwork and velocity/tapestry view technologies. Spring's dispatherservlet definition is extremely flexible, because it is an open source framework that allows us to easily customize our processing processes through source code.

In order to achieve page caching, you can rewrite the Dispatherservlet doservice () method, which presents a solution:

Use Wrappedresponse to obtain handler processed content and then cache it so that you can output the cached content directly the next time you request it.

Because caching is implemented at the Dispatherservlet level, either JSP or velocity can work properly.

It is not implemented on the filter layer because filter does not know the context of the request.

We'll discuss in more detail how to implement caching for a particular page in the future.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.