PHP Classes

PHP Browser Cache Handler: Issue HTTP not modified response for cached files

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-08-29 (3 days ago) RSS 2.0 feedNot enough user ratingsTotal: 59 All time: 10,510 This week: 78Up
Version License PHP version Categories
cachehandler 1.0MIT/X Consortium ...5HTTP, PHP 5, Files and Folders, Cache, P...
Description 

Author

This class can issue HTTP, not modified response for cached files.

It can check the current HTTP request to verify if it contains headers like If-None-Match or If-Modified-Since to determine if it will serve a given file or issue a 304 Not Modified HTTP status response.

The class can serve a given file as a response when it verifies that the browser does not have an up-to-date version of the specified file.

The file is served with a given Etag header value to let the browser determine the specific file version the server is sending.

Picture of Ramesh Narayan Jangid
  Performance   Level  
Name: Ramesh Narayan Jangid <contact>
Classes: 9 packages by
Country: India India
Innovation award
Innovation award
Nominee: 4x

Winner: 2x

Documentation

Cache Handler

Issue "HTTP/1.1 304 Not Modified" response for cached files

Usage

include_once ('CacheHandler.php');

$filePath = $_GET['file'];

$cacheHandler = new CacheHandler();
$cacheHandler->init($filePath);

  Files folder image Files (4)  
File Role Description
Plain text file CacheHandler.php Class Cache Handler
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:59
This week:0
All time:10,510
This week:78Up