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

Conversation

@escattone
Copy link
Contributor

This is another in a series of PR's that add the appropriate caching headers and related tests to all Kuma endpoints as part of the effort of placing a CDN in front of MDN. This PR adds caching headers and tests for the kuma.health.urls.

@escattone escattone requested a review from jwhitlock February 22, 2018 22:18
response = getattr(client, http_method)(url)
assert response.status_code == 405
assert 'Cache-Control' in response
assert 'max-age=0' in response['Cache-Control']
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: If the Cache-Control header is missing, then checking for max-age=0 will also fail, so checking for Cache-Control is redundant.

@jwhitlock
Copy link
Contributor

This looks good and works well on my development machine, using curl -v http://localhost:8000/healthz, etc.

The same nit on a redundant check for the Cache-Control header, which is a really weak preference, and could be merged as-is.

@codecov-io
Copy link

Codecov Report

Merging #4677 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4677      +/-   ##
==========================================
+ Coverage   95.27%   95.27%   +<.01%     
==========================================
  Files         261      261              
  Lines       23560    23579      +19     
  Branches     1691     1691              
==========================================
+ Hits        22447    22466      +19     
  Misses        902      902              
  Partials      211      211
Impacted Files Coverage Δ
kuma/health/tests/test_views.py 100% <100%> (ø) ⬆️
kuma/health/views.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a29dc0a...f957da7. Read the comment docs.

@escattone escattone merged commit 4ba6058 into mdn:master Feb 23, 2018
@escattone escattone deleted the cache-control-headers-health-1431259 branch February 23, 2018 18:01
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.

3 participants