From 3a852c8b5f5d8670434f8d36f340add86b53f13c Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 18 Apr 2005 13:38:11 +0000 Subject: [PATCH] * Use templates_c for caching remote rss feeds * 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 | 3 +++ .../serendipity_plugin_remoterss.php | 2 +- rss.php | 2 +- serendipity_config.inc.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 8b65798..d3f9bd8 100644 --- 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) diff --git a/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php b/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php index e43805e..c5dfecd 100644 --- a/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php +++ b/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php @@ -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 fcd9042..12740b8 100644 --- 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']; diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index a913114..621cde8 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -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(); } -- 2.39.5