HTTP caching : HttpResponse : Development PHP Source Code


PHP Source Code » Development » HttpResponse »

 

HTTP caching


One of the main key features of HttpResponse is HTTP caching. HttpResponse will calculate an ETag based on the http.etag_mode INI setting as well as it will determine the last modification time of the sent entity. It uses those two indicators to decide if the cache entry on the client side is still valid and will emit an "304 Not Modified" response if applicable.
    
<?php    
HttpResponse
::setCacheControl('public');    
HttpResponse::setCache(true);    
HttpResponse::capture();    
    
print 
"This will be cached until content changes!\n";    
print 
"Note that this approach will only save the clients download time.\n";    
?>    
    


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Development
» HttpResponse