ComputerScienceHouse / packet

Web packet written in Python for Computer Science House
MIT License
23 stars 26 forks source link

Cache RIT Images better #292

Open mxmeinhold opened 3 years ago

mxmeinhold commented 3 years ago

This is a bad cache https://github.com/ComputerScienceHouse/packet/blob/f61cd2b5b616e3b7f35fad95b515313ea2d50bcb/packet/context_processors.py#L58-L70

It caches the first call to this function for any given username (up to 256 of them) via functools.lru_cache, which is bad, because it kinda defeats the point of gravatar.

We could do some form of caching, but probably shouldn't. Loading these images lazily in the frontend would probably be much better.

At the very least, please remove the cache so we can stop kicking the pods to have photos update.