class NoCacheFilters {

    def filters = {
        all(controller:'*', action:'*') {
            before = {
                
                //Turn off as much caching as we can.
                response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate")// HTTP 1.1
                response.addDateHeader('Expires', 0)
                response.setDateHeader('max-age', 0)
                response.setIntHeader ('Expires', -1) //prevents caching at the proxy server
                response.addHeader('cache-Control', 'private') //IE5.x only 
                response.addHeader('Pragma', 'no-cache') //HTTP 1.0

            }

            after = {
                
            }
            afterView = {
                
            }
        }
    }
    
}
