<blockquote>
<p>If you're not sure how to handle the caches for users etc (and to be honest, I don't know either) then just leave these methods and come back to them in a separate PR. I'd prefer to see one PR that covers all the straightforward refactoring and is easy to review, and a second PR that covers tough things but is nice and short.</p>
</blockquote>
<p>I'm seeing lots of <strong>CACHE</strong> entries on the Rails console. Does that mean that the builder framework is clever enough to do its own caching? If so, I would just remove the already commented <code>changeset_cache</code> and <code>user_display_cache</code> initialization, and we're done with the topic.</p>
<pre><code> CACHE Changeset Load (0.0ms) SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2 [["id", 1479], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
CACHE User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
Node Load (0.6ms) SELECT "current_nodes".* FROM "current_nodes" INNER JOIN "current_way_nodes" ON "current_nodes"."id" = "current_way_nodes"."node_id" WHERE "current_way_nodes"."way_id" = $1 ORDER BY "current_way_nodes"."sequence_id" ASC [["way_id", 4000260693]]
↳ app/views/api/ways/_way.xml.builder:12
CACHE Changeset Load (0.0ms) SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2 [["id", 1481], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
CACHE User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
Node Load (0.4ms) SELECT "current_nodes".* FROM "current_nodes" INNER JOIN "current_way_nodes" ON "current_nodes"."id" = "current_way_nodes"."node_id" WHERE "current_way_nodes"."way_id" = $1 ORDER BY "current_way_nodes"."sequence_id" ASC [["way_id", 4000281620]]
↳ app/views/api/ways/_way.xml.builder:12
CACHE Changeset Load (0.0ms) SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2 [["id", 1480], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223?email_source=notifications&email_token=AAK2OLLIFKAK5AIGUEJBXPTP4UAOBA5CNFSM4HLMFYO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYX6YLI#issuecomment-506457133">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK4KXDDJG6TL3PQVQLP4UAOBANCNFSM4HLMFYOQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLLKG3NPJLVT7OKHMW3P4UAOBA5CNFSM4HLMFYO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYX6YLI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2223?email_source=notifications\u0026email_token=AAK2OLLIFKAK5AIGUEJBXPTP4UAOBA5CNFSM4HLMFYO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYX6YLI#issuecomment-506457133",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2223?email_source=notifications\u0026email_token=AAK2OLLIFKAK5AIGUEJBXPTP4UAOBA5CNFSM4HLMFYO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYX6YLI#issuecomment-506457133",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>