阅读(4910) (0)

6.4 EvictInterceptor

2016-10-06 10:30:48 更新

EvictInterceptor 可以根据 CacheName 注解自动清除缓存。以下是示例代码:

@Before(EvictInterceptor.class)
@CacheName("blogList")
public void update() { getModel(Blog.class).update(); redirect("blog.html");
}
上例中的用法将清除 cacheName 为 blogList 的缓存数据,与其配合的 CacheInterceptor 会 自动更新 cacheName 为 blogList 的缓存数据。