Re: How can i only fetch a (rss/atom) feed when it's changed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/3/07, Greg Donald <greg@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > cat fsockopen.php
> #!/usr/bin/env php
> <?php
>
> $fp = fsockopen( 'destiney.com', 80, $errno, $errstr, 30 );
>
> if( !$fp )
> {
>    echo "$errstr ($errno)\n";
> }
> else
> {
>    $out = "GET /rss HTTP/1.1\r\n";
>    $out .= "Host: destiney.com\r\n";
>    $out .= "Connection: Close\r\n\r\n";
>
>    fwrite( $fp, $out );
>
>    while( !feof( $fp ) )
>        echo fgets( $fp, 128 );
>
>    fclose( $fp );
> }
>
> This particular request currently yields this Last-Modified header:
>
> Last-Modified: Fri, 21 Sep 2007 12:45:38 GMT
>
> This will let you develop a local cache for the rss contents and
> only update it when the remote file has changed.

i'm not sure that will work. since the feed is dynamically generated,
depending on how it is setup it would say it's new all the time, or
the modified date would be 1997 or something old to help force a
non-caching behavior. could also depend on the script generating the
feed...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux