mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-11-04 10:18:41 +02:00 
			
		
		
		
	Currently, soft reload uses the `VALIDATE_ALWAYS` flag to not only force revalidate the top level document, but also subresources. This causes content to be refetched from the web even if there are caches that are still valid and can be used. Chrome already has such behaviour to not revalidate all resources. Differential Revision: https://phabricator.services.mozilla.com/D122270
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			432 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			432 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
 | 
						|
function handleRequest(request, response) {
 | 
						|
  if (getState("expired_resource") == "") {
 | 
						|
    response.setHeader("Content-Type", "text/html", false);
 | 
						|
    response.setHeader("Cache-Control", "max-age=1001");
 | 
						|
    setState("expired_resource", "ok");
 | 
						|
  } else {
 | 
						|
    response.setHeader("Content-Type", "text/html", false);
 | 
						|
    response.setHeader("Cache-Control", "max-age=1003");
 | 
						|
    setState("expired_resource", "");
 | 
						|
  }
 | 
						|
}
 |