Bence Gedai
Bence Gedai

Reputation: 1511

Messenger bot pictures cached

I'm using express static to host pictures that my bot uses in cards. As I updated the pictures, nothing changed.

With some inspection in a browser, it seems likely, that Facebook caches my pictures.

Here is the url that Facebook fetches:

https://external-ams3-1.xx.fbcdn.net/safe_image.php?d=AQBuS02rfKAdYlVs&url=my_url&_nc_hash=AQA-wiEHYNeC11mJ

This is the old version of the picture. Although if I go to my_url referenced above, I get the updated, correct picture.

How can I force Facebook to reload this resource in cache?

UPDATE: I scraped my urls with Facebook Sharing Debugger, it shows the correct pictures, but in Messenger I still see the old versions.

Upvotes: 0

Views: 1337

Answers (2)

tpankake
tpankake

Reputation: 366

I've been unable to get the scrape working with messenger as well. What does seem to work, though, is "busting" the cache with useless query parameters. For example, if I want to show the image -

http://www.fnordware.com/superpng/pnggrad8rgb.png

in messenger but I want to be able to modify the image, I just use

http://www.fnordware.com/superpng/pnggrad8rgb.png?cachebuster=0002

When the value of cachebuster changes, Messenger will not find the cached item and will re-fetch your image. You can name the query parameter whatever you want of course. You could use a random number for the cachebuster value if you want to fetch every time, or you could just increment the value with each build or by hand when you modify an image.

Hope it helps someone.

Upvotes: 1

Touhidul Alam
Touhidul Alam

Reputation: 331

I guess it's similar scenario How to clear Facebook's image cache

Your previous business card won't be changed, but its supposed to change on newly posted business card.

Upvotes: 0

Related Questions