Re: Large(ish) scale pdf file cacheing
| From: | George Wilson | Date: | Wed, 05 Mar 2014 00:54:10 +0000 |
| Subject: | Re: Large(ish) scale pdf file cacheing | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323030@lists.php.net to get a copy of this message | ||
>
>
> I have got more or less the same problem. Less files (20.000), but
> larger (200MB average). Far too much to store on the webserver itself.
> They are video files, but that does not make the problem different.
>
> When a user requests a file that is not on the production server, a
> script fetches it from the archive (with 5TB storage). That takes half a
> minute, but would in your case be some seconds.
>
> The cron job that deletes files should not look at the creation time,
> not at the last-modified time, but rather ar the time of last access (ls
> -lu or PHP's fileatime). That way you will not delete files that are
> requested very frequently, but only those that are requested once in a
> while.
Ah, I had not thought of that. I suppose the simple solution is often best.
I highly doubt these documents will change considerably over time so I
would assume a longer cache expiration will not be a problem. Even so, we
could always have two cron jobs- one that periodically removes files with a
creation date older than a month or something.
Thank you two, these suggestions have been very helpful.
>
> Jan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>