通过页面(Tomcat)控制服务器端缓存? [英] Control server side caching by page (Tomcat)?

查看:152
本文介绍了通过页面(Tomcat)控制服务器端缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用部署在tomcat6中的grails应用程序,并希望能够在逐页的基础上启用或禁用服务器端页面缓存。换句话说,我希望能够指定缓存页面A,但不缓存页面B和C.。

这样的事情可能吗?如果是这样,最好的办法是什么?



预先致谢。

解决方案< Spring Cache插件允许您缓存控制器操作和服务方法调用,因此您可以注释可缓存的页面/操作,并保留不应该缓存的页面/注释: http://grails.org/plugin/springcache


I'm working with a grails application deployed in tomcat6, and I want to be able to enable or disable server side page caching on a "page by page" basis. In other words, I want to be able to specify, "Cache page A, but do not cache pages B and C."

Is such a thing possible? If so, what is the best way to do this?

Thanks in advance.

解决方案

The Spring Cache plugin lets you cache controller actions and service method calls, so you could annotate the cacheable pages/actions and leave the ones that shouldn't be cached un-annotated: http://grails.org/plugin/springcache

这篇关于通过页面(Tomcat)控制服务器端缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆