如何清除Play Framework 2.1中的所有缓存 [英] How to Clear All Cache in Play Framework 2.1

查看:126
本文介绍了如何清除Play Framework 2.1中的所有缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在使用Play的内置缓存API,如下所示: http://www.playframework.com/documentation/2.1.x/JavaCache

So I'm using Play's built in cache API as seen here: http://www.playframework.com/documentation/2.1.x/JavaCache

在我的代码中,我已经将缓存设置为每10分钟过期一次.我也在使用会话缓存样式.

In my code I've already set the cache to expire every 10 minutes. I am also using the session cache style.

所以我的主要问题是,由于要跟踪所有缓存确实非常困难,如何清除所有缓存?我知道使用Play的默认缓存是最少的,但目前对我来说效果很好.我只希望能够偶尔清除一次缓存,以防万一进行了太多会话,并且在我的代码中的某个地方堆积了缓存.

So my main question is, since it's gonna be really hard to keep track of all cache, how do I clear all of the cache? I know that using Play's default cache is minimal but it's working perfectly for me at this point. I just want the ability to clear the cache once in awhile just in case too many sessions are made and somewhere in my code it's piling up the caches.

推荐答案

The Play Java API does not provide a way to clear the whole cache.

您将必须使用自己的缓存插件,或扩展

You'll have to use your own cache plugin, or extends the existing one to provide this feature.

这篇关于如何清除Play Framework 2.1中的所有缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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