PHP Classes

Cache

Recommend this page to a friend!

      Barcode  >  All threads  >  Cache  >  (Un) Subscribe thread alerts  
Subject:Cache
Summary:Possible to have last 50 images cached?
Messages:2
Author:Ryan Christenson
Date:2007-04-26 17:21:39
Update:2007-04-30 18:17:13
 

  1. Cache   Reply   Report abuse  
Picture of Ryan Christenson Ryan Christenson - 2007-04-26 17:21:39
I noticed there's no cache option in this script, but would be nice if was added in future scripts. Is there any other way of going about to do this?

  2. Re: Cache   Reply   Report abuse  
Picture of Ryan Christenson Ryan Christenson - 2007-04-30 18:17:13 - In reply to message 1 from Ryan Christenson
I found a solution...

<?php
$filename = "/path/to/file.png";
if (file_exists($filename)) {
?>
<img src="/path/to/file.png" border="0">
<?php } else { ?>
<img src="/path/to/barcode.php?encode=UPC-A&bdata=111111111111&height=50&scale=2&bgcolor=%23FFFFEC&color=%23333366&file=name&type=png&Genrate=Submit" border="0" width="0" height="0">
<img src="/path/to/file.png" border="0">
<?php } ?>

If you want the file to be made in another folder:
&file=folder_name/file_name