News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Padraic Brady's Blog:
Optimise Your Zend_Feed Aggregators With HTTP Conditional GET Support
July 29, 2008 @ 11:13:06

Padraic Brady has written up a post on how he implemented conditional fetching (GET) as a part of the Zend_Feed component of the Zend Framework.

You see, by default, Zend_Feed is stupid. It will blindly drag in whatever RSS you point it at, parse it, present an accessible API (which is largely an abstract API across PHP DOM), and then merrily sit back while you are driven demented. There is a problem in blindly fetching RSS and parsing it - RSS feeds from a huge number of online sources only change rarely. The rest of the time the feed is unchanged.

The key is in the "Last-Modified" header data of the remote file (and ETag). He shows how to use this knowledge in a simple example - pulling data with a ZFBlog_Aggregate class and dumping the contents into a database table. This code checks the return status for a 304 ("Not modified") and closes out the connection if so. Otherwise it grabs the content and updates the database with the most recent fetch times to compare to the "Last-Modified".

0 comments voice your opinion now!
zendframework feed aggregator conditional get lastmodified


blog comments powered by Disqus

Similar Posts

William's Blog: A Popurls Clone with PHP, jQuery, Awesomeness

Padraic Brady's Blog: Zend Framework App Tutorial - Part 9: Zend_Vew and Displaying Blog Entries

Padraic Brady's Blog: Self-Contained Reusable Zend Framework Modules With Standardised Configurators

Jonathan Street's Blog: Plugins for php frameworks

Mike Willbanks' Blog: Zend Framework Cache Backend Libmemcached + Session Cache


Community Events





Don't see your event here?
Let us know!


list framework language podcast configure series laravel install opinion wordpress release developer unittest refactor code community interview threedevsandamaybe testing introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework