Jump to content

Cache a file


The Little Guy

Recommended Posts

no, that is the time the file was modified on the server, I want something that gives me when the file was last downloaded or something like that.

 

I have this:

 

header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");
// Set to expire in 2 days
header("Expires: " . date(DATE_RFC822,strtotime(" 2 day")));
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])){
  // if the browser has a cached version of this image, send 304
  header('Last-Modified: '.$_SERVER['HTTP_IF_MODIFIED_SINCE'],true,304);
  exit;
}

 

But it only seems to work on Apache.

Link to comment
https://forums.phpfreaks.com/topic/262694-cache-a-file/#findComment-1346450
Share on other sites

I need to know when a file was last modified

 

no, that is the time the file was modified

 

Make up your mind.

 

I want something that gives me when the file was last downloaded or something like that

 

Downloaded by whom?  Something like what?  Please include more details.

Link to comment
https://forums.phpfreaks.com/topic/262694-cache-a-file/#findComment-1346592
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.