How to force cache purge of Twitter Card's bots?

Twitter

Twitter Problem Overview


Literally I am looking for something like this:

https://developers.facebook.com/tools/debug/

But for Twitter Cards.

I put something wrong on my pages and I need them to be refreshed asap. But after google I only found this post:

https://dev.twitter.com/cards/troubleshooting

It seems Twitter only offers a weekly update. Is there any manual way to purge the wrongly cached pages?

Thanks

Twitter Solutions


Solution 1 - Twitter

I just managed to force it to update mine:

https://cards-dev.twitter.com/validator

In validating it updates its cache.

Solution 2 - Twitter

There's actually a simpler solution than what is proposed by Twitter:

  • Go to https://cards-dev.twitter.com/validator
  • Type in the URL you want to update, BUT with a change. For example, add ?utm_source=Whatever
  • Then just reloaded page with whatever tweet had your Twitter card

When Twitter validator encounters this different URL, it clears its cache and fetches the new version.

Solution 3 - Twitter

Following the steps in Twitter Card's Troubleshooting Guide actually forced the cache to clear in my case.

> When testing and/or iterating on Cards, it is sometimes helpful to test updates on your timeline. It may be possible to use the following technique to refresh the cache with your most up-to-date changes of your page’s Card.

> 1. Add Card metadata to a page 2. Tweet URL to that page

  1. Refresh your browser to view the Card contents on your timeline
  2. Change Card metadata on the page
  3. Take the same URL and runs it through bit.ly
  4. Tweet the new bit.ly URL
  5. Refresh your browser to view the updates

> Additionally, you can create multiple bit.ly URLs to allow for repeat testing.

I generated a bit.ly link to the page, then tweeted it, and then quickly deleted that tweet. It cleared the cache right away for the other tweet.

Solution 4 - Twitter

I ran across the same problem.

I needed to update a cached summary_large_image and the

Twitter Card Validator (https://cards-dev.twitter.com/validator)

was showing zero interest in wanting to update the previously cached image.

I fixed it by ensuring that every time Twitter fetches the page, the image URI updates to something Twitter has never seen or cached before.

This is as simple as deploying the uniqid() function in PHP and using that as the query at the end of the image URI.

e.g.

<?php

echo '
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="http://example.com/my-twitter-image.png?'.uniqid().'">
';

?>

Since the image URI is different every time Twitter goes to fetch it, this forces the cache to update.

Solution 5 - Twitter

There is a very simply way to force a cache invalidation of the Twitter Card bot.

If you are composing a tweet with an URL like https://example.com you only have to append a /# to the URL like so: https://example.com/# and it will immediatly fetch the updated metadata.

Solution 6 - Twitter

The only thing that helped me clear the cache was adding ?v1 to the end of the image URL:

<meta property="twitter:image" content="https://website.com/img/twitter.jpeg?v1" />

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAGamePlayerView Question on Stackoverflow
Solution 1 - TwitterJohn ConnorView Answer on Stackoverflow
Solution 2 - TwitterVic SeedoubleyewView Answer on Stackoverflow
Solution 3 - TwitterPat MigliaccioView Answer on Stackoverflow
Solution 4 - TwitterRounin - Standing with UkraineView Answer on Stackoverflow
Solution 5 - TwitterNielsView Answer on Stackoverflow
Solution 6 - TwitterAndrewView Answer on Stackoverflow