From 617de811f786dd9282ad52c062a58072027f5637 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 15 Jun 2012 12:07:31 +0200 Subject: Cache the minimized output also on the server --- lib/request.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/request.php (limited to 'lib/request.php') 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 @@ + + * 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; + } +} -- cgit v1.2.3