Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Add cache control to mvt endpoints #94861

Merged
merged 15 commits into from
Apr 15, 2021

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Mar 17, 2021

Summary

Because of #93531, mvt-tile-url refreshes are no longer reliant on the shape of the URL. This allows Maps to more aggressively add caching-instructions to the tile-response.

  1. This PR makes two changes to improve the caching:
  • adds a cache-expiry of 1hr to the response header of the tile
  • adds a refresh-token to the URL. This is only refreshed when the user clicks the "refresh" button. Otherwise it gets re-used.

The practical result is that the browser should return tiles from disc-cache during a user-session (up to an hour). Filtering (time, queries, ...) should trigger new request if there's a change, but not if the user moves back&forth between configurations. Pressing the refresh-button/auto-refresh will still trigger a new tile request, because Maps will update the URL by adding a token.

  1. This PR also adds the {x}/{y}/{z} in the url-path instead of the query-parameters. This is a cosmetic change, but it makes the shape of the endpoint more in-line with existing tile-servers.

Checklist

For maintainers

@thomasneirynck thomasneirynck added release_note:enhancement [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.13.0 WIP Work in progress labels Mar 17, 2021
@thomasneirynck thomasneirynck marked this pull request as ready for review April 6, 2021 13:13
@thomasneirynck thomasneirynck requested a review from a team as a code owner April 6, 2021 13:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@thomasneirynck thomasneirynck requested review from nreese and kindsun April 6, 2021 13:14
@thomasneirynck thomasneirynck removed the WIP Work in progress label Apr 7, 2021
@nreese
Copy link
Contributor

nreese commented Apr 12, 2021

@elasticmachine merge upstream

@nreese
Copy link
Contributor

nreese commented Apr 12, 2021

Looks like geo grid tiles super fine are not working with this PR

Screen Shot 2021-04-12 at 9 29 49 AM

@thomasneirynck thomasneirynck marked this pull request as draft April 12, 2021 19:31
@thomasneirynck thomasneirynck marked this pull request as ready for review April 12, 2021 19:32
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
code review, tested in chrome

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.6MB 2.6MB +1.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants