RSS: refresh rate?

前端 未结 1 2105
闹比i
闹比i 2021-02-15 09:31

I\'m writing a little application for my own use which will consume a publicly published RSS feed.

As far as I can tell, there\'s no subscribe/post mechanism in the prot

1条回答
  •  悲哀的现实
    2021-02-15 10:14

    Since RSS is built on the HTTP protocol, in general, most sites should respect the If-Modified-Since HTTP header. This is fairly lightweight and most servers should be able to return this information quickly.

    So for the client-side, you'll need to keep track of the last time you've sent the request and pass it to the server. If the server returns a 304 code, then you'll know that nothing has changed. But even more importantly, the server doesn't need to return the feed info, saving bytes of traffic. If the server returns a 200, then you'll need to process the results and save the response date.

    Ultimately, the answer to this question depends on what type of information is at the other end of the RSS feed. If it is a blog, then probably once every 4-8 hours is sufficient. But if RSS feed is a feed of stock quote (not likely, just an example), then every 10 minutes is not sufficient.

    0 讨论(0)
提交回复
热议问题