Anonymous ID: d227e4 June 6, 2020, 6:07 p.m. No.9511630   ๐Ÿ—„๏ธ.is ๐Ÿ”—kun

>>9511197

CODE FOR A CACHE BUSTING BOT

 

We also need a cache-busting bot in order to update the card periodically. If we want to show a growing number of comments over time, we cannot wait for Twitter to bust the cache once per week. It still won't update instantly, but if a tweet has been floating around for a while it will show an accurate comment count even if it is more than when the tweet went out originally.

 

Twitter does not expose their cache-busting feature via API, so we had to ping it via browser automation.

Anonymous ID: d227e4 June 6, 2020, 6:10 p.m. No.9511703   ๐Ÿ—„๏ธ.is ๐Ÿ”—kun

>>9511197

Refreshing a Card in a Tweet

 

Twitter web crawlers re-index the Card tag information on your page roughly every week.

 

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.

 

Add Card metadata to a page

Tweet URL to that page

Refresh your browser to view the Card contents on your timeline

Change Card metadata on the page

Take the same URL and runs it through

Tweet the new URL

Refresh your browser to view the updates

 

Additionally, you can create multiple URLs to allow for repeat testing. For example, adding dummy parameters to the end of your URL (http://www.test.com/?x=test1) or a unique hash (http://www.test.com/#test1) will generally not affect the page contents, but will generate a unique URL for each unique value of x.

 

My Card information now refreshes, but images are not updating. How do I get the images to refresh?/a>

Images referenced in a Card are also cached based on URL. This often causes images to not update when the above Card refresh technique is used.

 

To work-around this issue, you can add an extra parameter at the end of your image URL so that the Twitterbot treats the image as a unique URL and re-fetches the image.

 

 

https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/troubleshooting-cards