- // Set application instance here
- $a = self::getApp();
-
- /*
- * Pictures are stored in one of the following ways:
- *
- * 1. If a folder "proxy" exists and is writeable, then use this for caching
- * 2. If a cache path is defined, use this
- * 3. If everything else failed, cache into the database
- *
- * Question: Do we really need these three methods?
- */
- if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
- header('HTTP/1.1 304 Not Modified');
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
- header('Etag: ' . $_SERVER['HTTP_IF_NONE_MATCH']);
- header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (31536000)) . ' GMT');
- header('Cache-Control: max-age=31536000');
-
- if (function_exists('header_remove')) {
- header_remove('Last-Modified');
- header_remove('Expires');
- header_remove('Cache-Control');
+ if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) {
+ header("HTTP/1.1 304 Not Modified");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
+ if (!empty($_SERVER["HTTP_IF_NONE_MATCH"])) {
+ header("Etag: " . $_SERVER["HTTP_IF_NONE_MATCH"]);