Categories

  • Apple (15)
  • Coding (4)
  • del.icio.us (14)
  • General (136)
  • Life (10)
    • Remodel (1)
  • Politics (16)
  • Project Steamroller (1)
  • Spam (11)
  • Sysadmin (9)
  • Tech/Geek (15)
  • Uncategorized (52)

Ye Olde Posts

  • March 2010 (1)
  • January 2010 (3)
  • December 2009 (1)
  • November 2009 (1)
  • October 2009 (2)
  • September 2009 (1)
  • August 2009 (3)
  • July 2009 (3)
  • June 2009 (2)
  • May 2009 (2)
  • April 2009 (1)
  • March 2009 (4)
  • February 2009 (2)
  • January 2009 (1)
  • December 2008 (1)
  • September 2008 (1)
  • July 2008 (1)
  • May 2008 (5)
  • April 2008 (2)
  • March 2008 (9)
  • February 2008 (5)
  • January 2008 (6)
  • December 2007 (7)
  • November 2007 (2)
  • October 2007 (6)
  • August 2007 (7)
  • July 2007 (2)
  • June 2007 (3)
  • May 2007 (3)
  • April 2007 (8)
  • March 2007 (8)
  • February 2007 (10)
  • January 2007 (3)
  • December 2006 (2)
  • November 2006 (1)
  • October 2006 (2)
  • August 2006 (2)
  • July 2006 (2)
  • June 2006 (2)
  • May 2006 (5)
  • April 2006 (2)
  • February 2006 (1)
  • January 2006 (2)
  • December 2005 (2)
  • November 2005 (2)
  • October 2005 (3)
  • September 2005 (1)
  • August 2005 (1)
  • July 2005 (3)
  • June 2005 (3)
  • May 2005 (1)
  • April 2005 (1)
  • March 2005 (1)
  • February 2005 (4)
  • January 2005 (1)
  • December 2004 (3)
  • October 2004 (3)
  • July 2004 (1)
  • April 2004 (5)
  • March 2004 (5)
  • February 2004 (5)
  • January 2004 (3)
  • December 2003 (2)
  • November 2003 (9)
  • October 2003 (5)
  • September 2003 (4)
  • August 2003 (3)
  • July 2003 (2)
  • June 2003 (8)
  • May 2003 (5)
  • April 2003 (4)
  • March 2003 (10)
  • February 2003 (25)
  • January 2003 (12)

Blog backend updated

Aug30
2003
5 Comments Written by Craig

So I’ve updated the RSS feeds somewhat, as well as moving to a newer version of the backend software, so now it should be the case that the web server sends 304′s for the RSS feeds if nothing’s changed in the database. I’ve been doing gzipping of the content all along, but it seems most aggregators don’t support compressed HTTP streams (why would someone write their own HTTP client code these days ?!??). Now that NetNewsWire does though, people should find that helpful if they’re using NNW. Also imported my own aggregator list to a blogroll on the right of my main blog page. I’ll try to write an applescript to automate updating things when I subscribe/unsubscribe, but see below for why I might not do that — of course there’s no way to have NNW automatically call my script to say “By the way, subscriptions just changed”… I should probably also include a link to the OPML for those sources as well…

Posted in General
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

5 Comments

  1. Malte S. Stretz's Gravatar Malte S. Stretz
    9/2/2003 at 11:03 pm | Permalink

    Hi Craig :)
    I wondered about that 304 stuff; how did you do it? Does the app has to send an If-Modified-Since or do you somehow track the IPs and access times of your visitors? (I’m just thinking about hacking on KNewsTicker a bit — when SA 2.60 is finally out that is :o)

    Reply
  2. Craig's Gravatar Craig
    9/6/2003 at 5:46 pm | Permalink


    // Handle Conditional GET
    // Get the time of the most recent article
    $sql = "SELECT max(post_date) FROM $tableposts";
    $maxdate = $wpdb->get_var($sql);
    $unixtime = strtotime($maxdate);
    // format timestamp for Last-Modified header
    $clast = gmdate("D, d M Y H:i:s GMT",$unixtime);
    $cetag = md5($last);
    $slast = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
    $setag = $_SERVER['HTTP_IF_NONE_MATCH'];
    // send it in a Last-Modified header
    header("Last-Modified: " . $clast, true);
    header("Etag: " . $cetag, true);
    // compare it to aggregator's If-Modified-Since and If-None-Match headers
    // if they match, send a 304 and die
    // This logic says that if only one header is provided, just use that one,
    // but if both headers exist, they *both* must match up with the locally
    // generated values.
    //if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){
    if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) {
    header("HTTP/1.1 304 Not Modified");
    echo "rnrn";
    exit;
    }

    Reply
  3. Chris's Gravatar Chris
    9/9/2003 at 8:54 pm | Permalink

    Craig, if you want to save people and yourself a little bandwidth then might I politely suggest you ‘lite’ your feed from 25 posts to say 5-10?

    Also did you know that the site is sending every no-cache header in the book? (This appears to stop IE & Mozilla and Opera ever getting a 304, as they never send the hash on the repeat request..

    Cache-Control: no-store, no-cache, must-revalidate
    Cache-Control: post-check=0, pre-check=0
    Pragma: no-cache

    Feel free to completely ignore me though :D

    Reply
  4. Craig's Gravatar Craig
    9/9/2003 at 10:32 pm | Permalink

    Chris, I’ve added an optional GET parameter “n” which can be used to ask for however many posts you want, eg
    http://www.hughes-family.org/craig/b2/b2rss2.php?n=5
    The caching headers might as well tell things to cache for an hour, since

    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>

    anyway. I’ll fix that as soon as I:

    1. Find the caching header specs for the various headers
    2. Get time to do it

    Thanks for pointing those out though — they should really be fixed.

    Reply
  5. Chris's Gravatar Chris
    9/10/2003 at 6:36 pm | Permalink

    Cool :) I;ll use this and save you a little bandwidth and make my updates a little faster. http://www.hughes-family.org/craig/b2/b2rss2.php?n=4

    Setting it to 2 get the whole bunch in a single packet.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

CAPTCHA Image
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

Translate

EnglishFrenchGermanItalianPortugueseRussianSlovenianSpanish

Search

Recent Comments

  • Craig on On the efficiency of Virtual Machines
  • flickr.com/photos/jm on On the efficiency of Virtual Machines
  • jmason on Neat. A new way to track website visitors!
  • jmason on On the time domain, with regard to spam
  • pooya on Interesting Tivo trivia bit

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

EvoLve theme by Blogatize  •  Powered by WordPress Craigalog
Craig's musings