]> git.mjollnir.org Git - s9y.git/commitdiff
* Use templates_c for caching remote rss feeds
authorgarvinhicking <garvinhicking>
Mon, 18 Apr 2005 13:38:11 +0000 (13:38 +0000)
committergarvinhicking <garvinhicking>
Mon, 18 Apr 2005 13:38:11 +0000 (13:38 +0000)
* Do not call session_start() for RSS feeds to allow caching. If session_start
  is called, it would put no-cache, ... headers and disable 304/Not Modified
  operations. This is a possibly hazardrous change, we need to further
  watch this. That's also the reason I won't backport the fix to 0.8

docs/NEWS
plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php
rss.php
serendipity_config.inc.php

index 8b65798581e39837f8a4f051a957172e38c0746e..d3f9bd827ee868e325d4c8b169714c4eeef1a74e 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 0.9 ()
 ------------------------------------------------------------------------
 
+    * RSS feed does no longer initialize a session and thus now causes
+      proper cachability for Conditional Get (garvinhicking)
+
     * "Comments" Sidebar plugin can now have a custom title
       (garvinhicking)
 
index e43805e9c8a5f14e02b81e999a49f72c8a741d68..c5dfecdda24a3d9a10fe95c19de4410cf56cbbf0 100644 (file)
@@ -434,7 +434,7 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
         }
 
         if (trim($rssuri)) {
-            $feedcache = $serendipity['serendipityPath'] . 'archives/remoterss_cache_' . preg_replace('@[^a-z0-9]*@i', '', $rssuri) . '.dat';
+            $feedcache = $serendipity['serendipityPath'] . 'templates_c/remoterss_cache_' . preg_replace('@[^a-z0-9]*@i', '', $rssuri) . '.dat';
             if (!file_exists($feedcache) || filesize($feedcache) == 0 || filemtime($feedcache) < (time() - $cachetime)) {
 
                 if ($feedtype == 'rss') {
diff --git a/rss.php b/rss.php
index fcd90426460a262b1c09db9d27771e6e75085ca0..12740b82d8d4ed88bba695d4497af835bd4fc6f1 100644 (file)
--- a/rss.php
+++ b/rss.php
@@ -3,7 +3,7 @@
 # All rights reserved.  See LICENSE file for licensing details
 
 header('Content-Type: text/xml; charset=utf-8');
-
+$delay_session_start = true;
 include_once('serendipity_config.inc.php');
 $version         = $_GET['version'];
 $description     = $serendipity['blogDescription'];
index a9131146358bd583943e998e5df6e4d6edf0de7f..621cde8239c63d4a9dd39c2774d96c7f7671698b 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
 # All rights reserved.  See LICENSE file for licensing details
 
-if (!headers_sent()) {
+if (!headers_sent() && !isset($delay_session_start)) {
     session_start();
 }