Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] Final preparations for OfflineFileSource - #3675

Closed
jfirebaugh wants to merge 3 commits into
masterfrom
offline-cache
Closed

jfirebaugh wants to merge 3 commits into
masterfrom
offline-cache

Conversation

@jfirebaugh

Copy link
Copy Markdown
Contributor

This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource (which needs access to a FileSource from which to download), and no more.

👀 @kkaefer

@jfirebaugh jfirebaugh changed the title Offline cache [core] Moving caching logic to DefaultFileSource Jan 23, 2016
@jfirebaugh jfirebaugh changed the title [core] Moving caching logic to DefaultFileSource [core] Final preparations for OfflineFileSource Jan 23, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we want to add a gtest.h dependency to non-test headers. I tried various permutations of friend class Storage; and forward declarations but couldn't it to work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could either add forward declarations in the global namespace, and use friend class ::Storage_Foo_Test or something like this:

#ifdef GTEST_TEST
public:
#else
private:
#endif

This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
@jfirebaugh

Copy link
Copy Markdown
Contributor Author

I believe 31dd6e7 makes util::mapbox::canonicalURL unnecessary, since it effectively moves the normalization of mapbox:// URLs after the cache request. It will also change the effective URL key for many cached resources, since util::mapbox::canonicalURL(util::mapbox::normalize*URL(url)) != url. Should we increase the cache schema version to ensure consistency? This will blow away any existing caches, which we're likely to do for offline anyway.

@jfirebaugh

Copy link
Copy Markdown
Contributor Author

31dd6e7 makes util::mapbox::canonicalURL unnecessary

This isn't quite true. Tile URLs still contain embedded access tokens. This will cease to be an issue once we cache tiles by TileID rather than URL.

@kkaefer

kkaefer commented Jan 26, 2016

Copy link
Copy Markdown
Member

Tile URLs still contain embedded access tokens.

...can we come up with a mapbox:// tile URL and change the TileJSON our servers to output that URL?

@jfirebaugh

Copy link
Copy Markdown
Contributor Author

Going to cut a fresh offline PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants