How do you generate an RSS feed?

后端 未结 8 2160
野的像风
野的像风 2021-02-04 17:59

I\'ve never done it myself, and I\'ve never subscribed to a feed, but it seems that I\'m going to have to create one, so I\'m wondering. The only way that seems apparent to me i

8条回答
  •  走了就别回头了
    2021-02-04 18:41

    There are two ways to approach this. The first is to create the RSS document dynamically on request. The second is to write to a static file when a relevant change happens. The latter is faster, but requires a call to update the feed in (likely) many places vs. just one.

    With both methods, while you could edit the document with only the changes, it's much simpler to just rewrite the whole document every time with the most recent (10-50) items.

提交回复
热议问题