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

Add version information to all Timetable responses. #3

Open
faultyserver opened this issue Apr 5, 2017 · 1 comment
Open

Add version information to all Timetable responses. #3

faultyserver opened this issue Apr 5, 2017 · 1 comment

Comments

@faultyserver
Copy link
Member

From propershark/timetable_cpp#18, all responses from Timetable should include a version number indicating the version of the data that it is sourcing information from. When the backing data changes, the version number will change as well.

The proposal from that issue is to use a Last-Modified-esque timestamp for the version number to avoid ever having collisions.

@faultyserver
Copy link
Member Author

Thinking about it a little more, it would probably be good to include a provider_id or similar and apply this to all responses from both RPCs. That way, providers can be cached independently by a client, and they can invalidate their caches only for the providers whose version has changed.

This follows well with the suggested format of the version number as meta information in a wrapping hash, similar to most REST APIs:

{
  "version": 1491397984,
  "provider_id": "timetable1.shark-nyc1",
  "response": [,,,]
}

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

No branches or pull requests

1 participant