Add cache headers to static files served through Rails (#24120)
This commit is contained in:
		@@ -16,12 +16,7 @@ Rails.application.configure do
 | 
			
		||||
  # Run rails dev:cache to toggle caching.
 | 
			
		||||
  if Rails.root.join('tmp/caching-dev.txt').exist?
 | 
			
		||||
    config.action_controller.perform_caching = true
 | 
			
		||||
 | 
			
		||||
    config.cache_store = :redis_cache_store, REDIS_CACHE_PARAMS
 | 
			
		||||
 | 
			
		||||
    config.public_file_server.headers = {
 | 
			
		||||
      'Cache-Control' => "public, max-age=#{2.days.to_i}",
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    config.action_controller.perform_caching = false
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user