Include hostname in redis cache key #98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As reported in microsoft/PlanetaryComputer#65, items from planetarycomputer.microsoft.com endpoints were being returned with links to planetarycomputer-staging.microsoft.com. This was due to two things: the traffic from both hosts being routed to the same stack, which happens after a release due to our blue/green deployment workflow, and the redis caching mechanism not differentiating between traffic from staging and production. Requests from staging were being cached with a general key for that endpoint response, and that cached value was being returned for production requests.
This change includes the hostname in the redis cache keys to avoid this. All cached results will now be scoped to the hostname of the request.
In addition, this PR irons out some inconsistency with the installation of development dependencies. In one case, we were installing dev dependencies through setup.py, in the other, through requirements-dev.txt. This eliminates requirements-dev.txt and consolidates to the setup.py method. It also pins some dependency versions, and fixes some warnings output due to an upgrade in pytest_asyncio.
Type of change
Please delete options that are not relevant.
Checklist:
Please delete options that are not relevant.