Quantcast
Channel: James Childers — Blog
Viewing all articles
Browse latest Browse all 10

How to not cache XML or RSS feeds

$
0
0

Query strings. Its all about query strings.

It is a kinda hacky way of going about this – but basically the concept is you add a variable to your URL (the query string) that is different every time it is loaded (e.g., a math random function).

In my example, I am using SimplePie, a PHP RSS agregator class, to pull in my flickr photos.

$flickr->set_feed_url(array('http://api.flickr.com
/services/feeds/photos_public.gne?id=83039253@N00=
en-us&format=rss?'.rand(0,99)));

At the end of the URL you will notice ?'.rand(0,99). The ? is the beginning of the query string, and the “.” is concatenating a random number between 0 and 99 onto the end of the URL.

Hope this helps someone.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images