[openstreetmap/openstreetmap-website] Cache social link platform and name at save time (PR #6950)
Matt Van Horn
notifications at github.com
Fri Apr 3 20:17:48 UTC 2026
@mvanhorn commented on this pull request.
> @@ -2,13 +2,14 @@
<ul class="list-unstyled social_links mb-0">
<% social_links.each do |social_link| %>
+ <% parsed = Rails.cache.fetch("social_link/#{social_link.url}") { social_link.parsed } %>
Done in 4bd681e. Switched to Rails `cache` helper so the entire `<li>` fragment is cached per URL. Eliminates the `parsed` variable and skips both parsing and rendering on cache hits.
Agreed that icon changes from new service support would need a cache clear, but that seems rare enough to handle manually.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6950?email_source=notifications&email_token=AAK2OLMF67YNHMSOISLL7NT4UAL6ZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMBVG4YTKMZXG4ZKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#discussion_r3034244749
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6950/review/4057153772 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260403/7f53308d/attachment.htm>
More information about the rails-dev
mailing list