[openstreetmap/openstreetmap-website] Consequences of using the cache (Issue #6989)

Andy Allan notifications at github.com
Thu Apr 9 10:58:30 UTC 2026


gravitystorm created an issue (openstreetmap/openstreetmap-website#6989)

I was reviewing #6950 when I realised that I don't really know enough about the rails cache to properly make a decision. The main question I have is what are the "cons" in the pros and cons of adding more things to the cache?

As far as I understand, [OSMF uses memcached](https://github.com/openstreetmap/chef/tree/9773acd6bc9041bb87287bf409a3b75434c55fae/cookbooks/memcached) as the backing store for the cache. It's set to [8GB RAM per front-end server](https://github.com/openstreetmap/chef/blob/9773acd6bc9041bb87287bf409a3b75434c55fae/roles/web-frontend.rb#L22-L24) and I'm not sure if that's 3x8 separate caches, or one larger 24GB shared cache distributed across all frontends. If it's not distributed then do we end up with 3x copies of everything that we cache? Or how does that currently work? It also looks like the same cache is used by cgimap, is that right?

I also know that the length of time sessions are cached for is already fairly short, see discussion at https://github.com/openstreetmap/operations/issues/1107 . If we start adding more to the cache, then I anticipate that the eviction times will be even shorter, both for sessions and also for everything else using the cache.

To a certain extent, this is not strictly a "openstreetmap-website" problem, because OSMF (and other deployments) can choose their own caching strategies, for example moving to disk-based caching (see theory behind [SolidCache](https://github.com/rails/solid_cache) etc). But I don't want to make changes here that accidentally make it harder to run in production, regardless of the separation of responsibilities.

Does anyone have further thoughts on this? Should we be minimising our use of the cache, or going further than we currently do? When I wrote #6904 I anticipated storing the redundant information in the DB, but #6950 proposes moves that information to cache/RAM. How do we decide between these? Should we be storing additional html from the templates in the cache, as suggested by #6950? Or just the minimum data required? Should we be recommending deployments move to much larger disk-based caches, instead of using RAM?



-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6989
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/6989 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260409/9597c1a8/attachment-0001.htm>


More information about the rails-dev mailing list