Sending "Cache-Control: no-store" for Firefox
authorAlexander Ebert <ebert@woltlab.com>
Sat, 21 Dec 2013 14:27:43 +0000 (15:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 21 Dec 2013 14:27:43 +0000 (15:27 +0100)
wcfsetup/install/files/lib/util/HeaderUtil.class.php

index 57b6f0d02735700c97ea4afdc3f54a2e6db0e11d..f79c895507f0f30454fc42a118709b680582f0e4 100644 (file)
@@ -49,6 +49,10 @@ final class HeaderUtil {
                if (HTTP_ENABLE_NO_CACHE_HEADERS && !WCF::getSession()->spiderID) {
                        self::sendNoCacheHeaders();
                }
+               else if (!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
+                       // Firefox serves pages from cache, causing certain HTML elements to stay in an outdated state
+                       @header('Cache-Control: no-store');
+               }
                
                if (HTTP_ENABLE_GZIP && HTTP_GZIP_LEVEL > 0 && HTTP_GZIP_LEVEL < 10 && !defined('HTTP_DISABLE_GZIP')) {
                        if (function_exists('gzcompress') && !@ini_get('zlib.output_compression') && !@ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {