Changeset 92 for devel/search

Show
Ignore:
Timestamp:
01/11/06 01:00:45 (3 years ago)
Author:
sven
Message:

more RSS HTTP

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/search/rss.php

    r45 r92  
    99                run("search:all:tagtypes"); 
    1010 
    11                 header("Content-Type: text/xml"); 
    12                 echo run("search:all:display:rss", $_REQUEST['tag']); 
     11                $output = run("search:all:display:rss", $_REQUEST['tag']); 
    1312                 
     13                if ($output) { 
     14                        header("Pragma: public"); 
     15                        header("Cache-Control: public");  
     16                         
     17                        // no time data on this RSS, at least not without rewriting some function outputs 
     18                         
     19                        $if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); 
     20                         
     21                        $etag = md5($output); 
     22                         
     23                        if ($if_none_match == $etag) { 
     24                                header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); 
     25                                exit; 
     26                        } 
     27                         
     28                        header("Content-Length: " . strlen($output)); 
     29                        header('ETag: "' . $etag . '"'); 
     30                         
     31                        header("Content-type: text/xml"); 
     32                        echo $output; 
     33                } 
    1434?>