Barcode.class: pokus o cache-control
authorThomas Mudrunka <tomas@mudrunka.cz>
Wed, 14 Dec 2011 04:48:14 +0000 (05:48 +0100)
committerThomas Mudrunka <tomas@mudrunka.cz>
Wed, 14 Dec 2011 04:48:14 +0000 (05:48 +0100)
lib/Barcode.class.php

index b4231e660bffe34e80671feb01882ae788c7cf9d..6b2ed5613bbf66a3b1adb3c1fb4e98eff132205e 100755 (executable)
@@ -51,7 +51,10 @@ class Barcode {
        }
 
        static function download_barcode($string='EXAMPLE', $convert='png', $enctype='code128b') {
-               if(self::test()) header('Content-Type: image/png'); else die();
+               if(self::test()) {
+                       header('Content-Type: image/png');
+                       header('Cache-Control: max-age=604800, public'); //1week caching
+               }       else die();
                die(self::cached_barcode($string,$convert,$enctype));
        }
 }
This page took 0.118387 seconds and 4 git commands to generate.