Tuesday, October 28, 2008

One of the main key features of HttpResponse is 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.




    


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";    

?>    

    


More Examples PHP class HttpResponse

No comments: