{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2951","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-js","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2951/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2951/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2951/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/2951","id":169698261,"number":2951,"title":"Share parsed tiles across maps","user":{"login":"lucaswoj","id":281306,"avatar_url":"https://avatars.githubusercontent.com/u/281306?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswoj","html_url":"https://github.com/lucaswoj","followers_url":"https://api.github.com/users/lucaswoj/followers","following_url":"https://api.github.com/users/lucaswoj/following{/other_user}","gists_url":"https://api.github.com/users/lucaswoj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswoj/subscriptions","organizations_url":"https://api.github.com/users/lucaswoj/orgs","repos_url":"https://api.github.com/users/lucaswoj/repos","events_url":"https://api.github.com/users/lucaswoj/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswoj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/labels/enhancement","name":"enhancement","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-05T21:17:18Z","updated_at":"2016-08-05T21:36:12Z","closed_at":null,"body":"When one page contains many maps which use the similar styles to show the same geographic region we can improve performance by sharing parsed tiles between maps. \r\n\r\n# 1. Create Globally Unique Tile Identifier\r\n\r\nTiles can be uniquely identified by a hash of their\r\n\r\n - coordinate\r\n - source's URL or data\r\n - style layer's `type`\r\n - style layer's `layout` properties\r\n - style layer's `paint` properties which are property-functions \r\n\r\nI'm not sure how exactly to handle ref families. The easiest solution is to have an entry in the tile cache per layer, not per ref family. Every entry within the same ref family would still point to the same `Tile` object. \r\n\r\nThis could replace the existing `Tile#id` property \r\n\r\n# 2. Create Shared Tile Cache\r\n\r\nThe simplest way to implement this is to replace the `SourceCache#_cache` instance property with a static `SourceCache.cache` property, keyed by the globally unique tile identifier ☝️. We will need to tweak the cache's retention policy to suit. \r\n\r\ncc @anandthakker "},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments/237971993","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/2951#issuecomment-237971993","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2951","id":237971993,"user":{"login":"anandthakker","id":4974151,"avatar_url":"https://avatars.githubusercontent.com/u/4974151?v=3","gravatar_id":"","url":"https://api.github.com/users/anandthakker","html_url":"https://github.com/anandthakker","followers_url":"https://api.github.com/users/anandthakker/followers","following_url":"https://api.github.com/users/anandthakker/following{/other_user}","gists_url":"https://api.github.com/users/anandthakker/gists{/gist_id}","starred_url":"https://api.github.com/users/anandthakker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandthakker/subscriptions","organizations_url":"https://api.github.com/users/anandthakker/orgs","repos_url":"https://api.github.com/users/anandthakker/repos","events_url":"https://api.github.com/users/anandthakker/events{/privacy}","received_events_url":"https://api.github.com/users/anandthakker/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T21:36:12Z","updated_at":"2016-08-05T21:36:12Z","body":"👍 \r\n\r\n@lucaswoj thinking about this in the context of custom sources, it probably makes sense to implement 1 in a way that allows the `Style` and the `Source` to share responsibility for generating a tile's unique id."}}
{"actor":{"display_login":"anandthakker"}}