class NoCacheFilters {

    def filters = {
        all(controller:'*', action:'*') {
            before = {
                
                //From the Acegi login controller
                response.setHeader('Cache-Control', 'no-cache') // 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 

                //Additional from the net
                response.addHeader('Pragma', 'no-cache')
                response.addHeader('Cache-Control', 'no-store')
                response.addHeader('Cache-Control', 'must-revalidate')

            }

            after = {
                
            }
            afterView = {
                
            }
        }
    }
    
}
