views/badge: implement database updates that do not happen 100% of the time #166
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.
Exactly what @fkobi and I came up with to implement.