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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.