Re: [openstreetmap/openstreetmap-website] [WIP] XML generation: nodes, ways, relations, map controller → view (#2223)
mmd
notifications at github.com
Thu Jun 27 18:22:24 UTC 2019
> 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.
I'm seeing lots of **CACHE** 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 `changeset_cache` and `user_display_cache` initialization, and we're done with the topic.
```
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
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2223#issuecomment-506457133
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190627/a6d31144/attachment.html>
More information about the rails-dev
mailing list