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

Reduce Bing Maps transactions and ion Bing sessions #7848

Merged
merged 3 commits into from
May 21, 2019
Merged

Conversation

mramato
Copy link
Contributor

@mramato mramato commented May 16, 2019

This is a simple PR to try and minimize the number of Bing transactions and ion Bing sessions over the course of a page. While we can't cache Bing metadata or ion endpoints across sessions, this type of basic caching is allowed and should dramatically reduce use for certain use cases.

  1. BingMapsImageryProvider now keeps a local cache of metadata for a given url/style. This means destroying and recreating instances multiple times still only uses a single transaction.

  2. IonImageryProvider now caches endpoint requests. This means that creating multiple IonImageryProviders for the same Bing asset will only use a single Bing session.

While use cases like Sandcastle, which uses an iframe, won't benefit at all from this change, applications that switch base layers often or destroy/recreate the viewer as part of a SPA will see dramatic improvement.

I'm open to other ideas to help reduce Bing transactions here, but obviously we need to stay withing the ToS for both Bing Maps and ion. If anyone has any thoughts, let me know.

This is a simple PR to try and minimize the number of Bing transactions
and ion Bing sessions over the course of a page. While we can't cache
Bing metadata or ion endpoints across sessions, this type of basic caching
is allowed and should dramatically reduce use for certain use cases.

1. BingMapsImageryProvider now keeps a local cache of metadata for a given
url/style. This means destroying and recreating instances multiple times
still only uses a single transaction.

2. IonImageryProvider now caches endpoint requests. This means that
creating multiple IonImageryProviders for the same Bing asset will only
use a single Bing session.

While use cases like Sandcastle, which uses an iframe, won't benefit at
all from this change, applications that switch base layers often or
destroy/recreate the viewer as part of a SPA will see dramatic improvement.
@mramato mramato requested review from shunter and tfili May 16, 2019 21:59
@cesium-concierge
Copy link

Thanks for the pull request @mramato!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

Copy link
Contributor

@shunter shunter left a comment

Choose a reason for hiding this comment

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

A few minor comments, otherwise this looks fine to me.

Specs/Scene/IonImageryProviderSpec.js Outdated Show resolved Hide resolved
Source/Scene/IonImageryProvider.js Outdated Show resolved Hide resolved
Specs/Scene/IonImageryProviderSpec.js Outdated Show resolved Hide resolved
@mramato
Copy link
Contributor Author

mramato commented May 21, 2019

Thanks @shunter. This is ready.

@tfili tfili merged commit 6bda940 into master May 21, 2019
@tfili tfili deleted the bing-usage branch May 21, 2019 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants