send expiry header for redirects
[phancap.git] / src / phancap / Image.php
index ab3868e18f236b8d14c2c25331fe1690e3971b1c..151847ece6430075bba4ee9747642377cfb8a1eb 100644 (file)
@@ -12,6 +12,16 @@ class Image
         $this->name = $name;
     }
 
+    /**
+     * @return integer Unix timestamp
+     */
+    public function getExpiryDate(Options $options)
+    {
+        $mtime = filemtime($this->getPath());
+
+        return $mtime + $options->values['smaxage'];
+    }
+
     public function getMimeType()
     {
         $ext = substr($this->name, -4);