Please keep it on list so others can benefit from the discussion.
Skip Evans wrote:
Stut wrote:
A well-formed feed should have a TTL value that defines how often the
feed should be checked.
I thought there might be something like that and looked at several of
the feeds in the DB and found nothing like that. Bummer.
You could create a system that keeps track of the minimum time between
new entries and uses that to decide how often to check it. Most podcasts
are fairly regular so that should work fairly well for most.
Make sure you make use of the If-Modified-Since HTTP header when
requesting the feed. Make and store a hash of the feed contents
(before parsing) and use that to see if the feed has changed. Add
using the TTL value (if there is one) and that will ensure you only
parse the feed when it changes.
Okay, I'll check out the If-Modified-Since HTTP header, never used that
before, but I think I can guess how it will work.
Check the HTTP 1.1 RFC for full details, but it basically allows you to
tell the server the date and time you last downloaded it, and it will
only give it to you if it's changed. Clearly this relies upon the server
supporting this functionality for the file you're requesting. If the
feed is auto-generated it probably won't work at all, but given how
often these things are hit it's more than likely they come from a static
file in most cases.
That's basically it. I'm assuming that you're only storing the data
for each feed once even if several users are subscribed to it.
Yes, fortunately the original coder on this system set it up that way, I
was relieved to find.
Thanks much!!!
No problem. If it starts to overwhelm the server it's hosted on the
easiest and cheapest thing to do is add more hardware and split the
feeds across them.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php