How to prevent Grails from caching old versions of gsp file?

前端 未结 6 1465
心在旅途
心在旅途 2021-02-04 10:20

I am making modifications to /grails-app/views/index.gsp.

When I save the file and refresh http://localhost:8080/index.gsp in Firefox, I am getting an old version of the

6条回答
  •  [愿得一人]
    2021-02-04 10:35

    can't we use a filter like this?

    class CacheFilters{
    
        def filters = {
            all(controller: '*', action: '*') {
                before = {
                    ((HttpServletResponse) response).setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
                }
                after = {
    
                }
                afterView = {
    
                }
            }
        }
    
    }
    

提交回复
热议问题