---
title: "Version Badges: Now with Even Shorter Lifespans"
description: ""
canonical_url: "https://cloudsmith.com/changelog/version-badges-now-with-even-shorter-lifespans"
last_updated: "2021-04-23T15:49:00.000Z"
---
# Version Badges: Now with Even Shorter Lifespans

**Good news!** When you're embedding version badges elsewhere, you'll probably have noticed that services like GitHub like to cache them for an _excruciatingly_ long time*, often well beyond the lifetime of the package version itself. That changes _today_, along with a stylish (yes, stylish, not just style) update:

## Couple of things to note:

- The cache TTL (Time-To-Live) time has been reduced from 86400 seconds (1 day) to 300 seconds (5 mins).
- You can now generate badges for Docker images that have a version (non-hashref) assigned to them.
- The latest version badges will now show a "(latest)" prefix; you can turn this off via "show_latest=false".
- You can now customise the appearance of the badge (see below for more details).
- We'll now generate a (much) nicer "version not found" badge if a package or version isn't found.

## Tweaking the badge appearance:

- Figure out how you want to tweak it by looking at the [official shields attributes](https://shields.io/endpoint).
- Find the query string in the snippet (near the question mark), and add **<attribute>=<value>** to it.
- Don't forget to put an ampersand between your new value and the next part of the string.

For example, why not go for a [wild and crazy alternative colour badge](https://api-prd.cloudsmith.io/v1/badges/version/cloudsmith/cli/python/cloudsmith-cli/0.26.0/a=noarch;xf=bdist_wheel;xn=cloudsmith-cli;xv=py2.py3/?render=true&label=main%20registry&color=yellow&labelColor=purple&logoColor=white&style=for-the-badge)?

**Finally:** A huge thank you to [shields.io](https://shields.io/) for providing an amazing badge rendering service! \o/

_Note*: This isn't actually GitHub's fault, our previous use of shields.io meant the Cache-Control header was always returning a max-age of 86400. So we migrated to shields.io newer JSON-based endpoint to fix it._
