diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-15 12:07:31 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-18 11:11:46 +0200 |
commit | 617de811f786dd9282ad52c062a58072027f5637 (patch) | |
tree | 0cd1e80ae587a7273380e63ff4cfc121445b4a73 /lib/request.php | |
parent | 91f69858e49c3981d31eeee428c7bf3cd5e142fe (diff) | |
download | nextcloud-server-617de811f786dd9282ad52c062a58072027f5637.tar.gz nextcloud-server-617de811f786dd9282ad52c062a58072027f5637.zip |
Cache the minimized output also on the server
Diffstat (limited to 'lib/request.php')
-rw-r--r-- | lib/request.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/request.php b/lib/request.php new file mode 100644 index 00000000000..d152d0c73ba --- /dev/null +++ b/lib/request.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +class OC_Request { + static public function isNoCache() { + if (!isset($_SERVER['HTTP_CACHE_CONTROL'])) { + return false; + } + return $_SERVER['HTTP_CACHE_CONTROL'] == 'no-cache'; + } + + static public function acceptGZip() { + $HTTP_ACCEPT_ENCODING = $_SERVER["HTTP_ACCEPT_ENCODING"]; + if( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false ) + return 'x-gzip'; + else if( strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false ) + return 'gzip'; + return false; + } +} |