Facebook Image URL gets expired

Chirag Thakar picture Chirag Thakar · May 27, 2015 · Viewed 53.7k times · Source

I am pulling Facebook posts using facebook-graph API, now the problem is Image gets expired after few days.

I have the following URL for a single Image

Old Image URL which got expired

https://scontent-a.xx.fbcdn.net/hphotos-xfp1/v/l/t1.0-9/p180x540/14377_340369866155028_6836158858133154924_n.jpg?oh=7ed0d8818ad54fac851b036d24f5e674&oe=55579EE3

New Image working URL Is

https://scontent-sin1-1.xx.fbcdn.net/hphotos-xfa1/v/l/t1.0-9/14377_340369866155028_6836158858133154924_n.jpg?oh=2f7ad72fa36fc026ad2bdcc1b0284146&oe=55C87432

I am frustrated with this issue, what could be the solution of it?

Answer

Chirag Thakar picture Chirag Thakar · May 27, 2015

What i came to know from other community about this issue is

"You should not store Facebook CDN URLs for long time use – they can change over time.

Either request the actual image and copy that to your server – or request the current CDN URL regularly.

(You might be tempted to try other workarounds, like extracting the actual image source URL from the CDN link, but I would advise against that – because the format of that might change at any time as well.)"