views/badge: implement database updates that do not happen 100% of the time #166

Open
opened 2026-04-17 09:18:25 +00:00 by fkobi · 2 comments
Owner

Badge is viewed way more than our website but in 1.0 it triggers checks regardless.

The badge requests should be treated differently since scrapers also trigger them and they account for a big amount of traffic.

In a discussion with @tobiasd we agreed that a higher-than-usual age threshold will suffice.

Also the caching of the data should be adjusted to equal our internal timeout

Badge is viewed way more than our website but in 1.0 it triggers checks regardless. The badge requests should be treated differently since scrapers also trigger them and they account for a big amount of traffic. In a discussion with @tobiasd we agreed that a higher-than-usual age threshold will suffice. Also the caching of the data should be adjusted to equal our internal timeout
fkobi added this to the 2.0 -- A thought-out backend redesign milestone 2026-04-17 09:18:25 +00:00
fkobi added the enhancement
component
backend
prio
mid
labels 2026-04-17 09:18:25 +00:00
Owner

This has been a deliberate decision. Most users don't go to api.reuse.software have their project checked for the latest status. They include the badge to their README, and rely on it to be in sync.

Please compare the (virtual) cost of traffic with the cost of out-of-sync badges and therefore lower user satisfaction, and find a good compromise for age threshold. Spontaneously, IMHO the cache should be no longer than 5 minutes. Ideally, it should remain 0 or 1 minutes if the traffic and performance effects are acceptable.

This has been a deliberate decision. Most users don't go to api.reuse.software have their project checked for the latest status. They include the badge to their README, and rely on it to be in sync. Please compare the (virtual) cost of traffic with the cost of out-of-sync badges and therefore lower user satisfaction, and find a good compromise for age threshold. Spontaneously, IMHO the cache should be no longer than 5 minutes. Ideally, it should remain 0 or 1 minutes if the traffic and performance effects are acceptable.
Member

Exactly what @fkobi and I came up with to implement.

Exactly what @fkobi and I came up with to implement.
Sign in to join this conversation.