WordPress / openverse-api

The Openverse API allows programmatic access to search for CC-licensed and public domain digital media.
https://api.openverse.engineering/v1
MIT License
77 stars 51 forks source link

Use `get_redis_connection` rather than `django.core.cache` for thumbnail timeouts #1073

Closed AetherUnbound closed 1 year ago

AetherUnbound commented 1 year ago

Description

Capturing which domains had thumbnail timeouts on the API was added in #982. However, @sarayourfriend found that using django.core.cache implicitly uses the default Django cache timeout. For our setup this is currently 5 minutes, which means that the thumbnail timeout entries only exist in Redis for 5 minutes.

We would like to switch the thumbnail timeout capturing from using the default django.core.cache to use get_redis_connection instead, so that no default timeout is applied when the associated values are added or updated.

Additional context

This is a stop-gap change, and is intended to be supplanted by #1072

sarayourfriend commented 1 year ago

This was incidentally resolved by #1056.