Ashesh
Ashesh

Reputation: 949

RSS feed created with PHP is not updating

I created a RSS feed using PHP. Basically using the header:

header("Content-Type: application/rss+xml; charset=ISO-8859-1");

And then creating the xml string and outputting it.

Now the problem is even when I make changes to the PHP script that outputs the RSS feed, it takes forever for those changes to propogate and be seen in the RSS reader.

How do I overcome this problem ?

Upvotes: 0

Views: 318

Answers (1)

Felds Liscia
Felds Liscia

Reputation: 389

You could try using HTTP cache directives.

I'd suggest using this for testing:

Cache-Control: no-cache

And this for production:

Cache-Control: max-age=1800

It will make the content expire every 30 minutes (1800 = 30*60).

Tip: Do not create the XML as a string. Use the DomDocument API to create the XML and it will be ALWAYS right. No strange encoding and stuff like that.

Upvotes: 1

Related Questions