From 01b089d9be046db1253cb3bb90e8635b50fddd84 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 4 Dec 2009 12:36:00 -0500 Subject: Added minify plugin --- .../min_unit_tests/HTTP_ConditionalGet/2.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/2.php (limited to 'plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/2.php') diff --git a/plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/2.php b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/2.php new file mode 100644 index 000000000..9b66f2493 --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_ConditionalGet/2.php @@ -0,0 +1,44 @@ + $lastModified +)); +if ($cg->cacheIsValid) { + $cg->sendHeaders(); + // we're done + exit(); +} + +// generate content +$title = 'Last-Modified is known : add Content-Length'; +$explain = ' +

Here, like the first example, we know the Last-Modified time, +but we also want to set the Content-Length to increase cacheability and allow +HTTP persistent connections. Instead of sending headers immediately, we first +generate our content, then use setContentLength(strlen($content)) +to add the header. Then finally call sendHeaders() and send the +content.

+

Note: This is not required if your PHP config buffers all +output and your script doesn\'t do any incremental flushing of the output +buffer. PHP will generally set Content-Length for you if it can.

+

This script emulates a document that changes every ' .$every. ' seconds. +
This is version: ' . date('r', $lastModified) . '

+'; + +require '_include.php'; +$content = get_content(array( + 'title' => $title + ,'explain' => $explain +)); + +$cg->setContentLength(strlen($content)); +$cg->sendHeaders(); +send_slowly($content); + -- cgit v1.2.3-54-g00ecf