discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

Clear the metatag/embed cache when someone posts a link

Open emptycrown opened this issue 6 years ago • 10 comments

Our site has links that people share in Discord that have og:video tags so people can watch video directly in the app. The meta tags change when we process a "better" version of the video on the server but it seems like Discord caches the metatag data for each user when they first look at the link. Is it possible to clear the cache somehow when we update our metatags?

emptycrown avatar May 22 '20 22:05 emptycrown

An embed is "permanently" cached in a message once it's posted. Meaning, the unfurled embed within a message will never change - and subsequent retrievals of that message won't trigger a re-fetch of the embed. Additionally, for each unique URL, we cache the result of the unfurl for up to 30 minutes, so if subsequent people post that link, it's not re-requested.

jhgg avatar May 23 '20 02:05 jhgg

Note: you could add a # or a ? and that will count as a "new URL" without changing the URL path

mr-cheffy avatar Mar 25 '23 12:03 mr-cheffy

a # or a ? does not count as a "new URL" in Discord for me

surajlulla avatar Sep 11 '23 14:09 surajlulla

Really surprising and painfull at times that there's nothing like Facebooks Sharing Debugger 😰

But it could at least occasionally re-check at least if the same link was shared again or something

CanRau avatar Oct 21 '23 04:10 CanRau

there is, https://discord.com/developers/embeds

advaith1 avatar Oct 21 '23 04:10 advaith1

Didn't know about this debugging tool. Thanks!

Best Regards, Suraj

On Sat, Oct 21, 2023 at 9:57 AM advaith @.***> wrote:

there is, https://discord.com/developers/embeds

— Reply to this email directly, view it on GitHub https://github.com/discord/discord-api-docs/issues/1663#issuecomment-1773655758, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKDAQVLS3242V7KSVOD75LYANFMVAVCNFSM4NIFGPV2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGM3DKNJXGU4A . You are receiving this because you commented.Message ID: @.***>

surajlulla avatar Oct 23 '23 05:10 surajlulla

That's very helpful thank you though it won't let you force a refresh as I understand it like Facebooks debugger right?

CanRau avatar Oct 24 '23 04:10 CanRau

results on the embed debugger page are not cached.

devsnek avatar Oct 24 '23 06:10 devsnek

Siemka

Mati199330 avatar Oct 24 '23 06:10 Mati199330

results on the embed debugger page are not cached.

That makes sense, though cache is not cleared for links already shared in Discord messages right?

CanRau avatar Oct 24 '23 11:10 CanRau