Skip to content

Commit

Permalink
BCDA-8124: Best practices for speeding up downloads (#200)
Browse files Browse the repository at this point in the history
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8124
## 🛠 Changes

1. Add best practices for speeding up downloads
2. Link to speeding up downloads from guide

## ℹ️ Context for reviewers
Content drafted in BCDA-8000 and published to
https://stage.bcda.cms.gov/build.html

## ✅ Acceptance Validation
Deployed to staging and verified links work

https://stage.bcda.cms.gov/build.html#speeding-up-downloads
<img width="1332" alt="image"
src="https://github.com/CMSgov/bcda-static-site/assets/10712873/51514ae5-5c9e-483e-9b90-4748718dab5d">

https://stage.bcda.cms.gov/build.html#requesting-all-three
<img width="814" alt="image"
src="https://github.com/CMSgov/bcda-static-site/assets/10712873/211ba2ed-74c3-46bb-ae0a-984183054ee1">


## 🔒 Security Implications

- [ ] This PR adds a new software dependency or dependencies.
- [ ] This PR modifies or invalidates one or more of our security
controls.
- [ ] This PR stores or transmits data that was not stored or
transmitted before.
- [ ] This PR requires additional review of its security implications
for other reasons.

If any security implications apply, add Jason Ashbaugh (GitHub username:
StewGoin) as a reviewer and do not merge this PR without his approval.
  • Loading branch information
greg-pf authored May 15, 2024
1 parent 351b677 commit b1127b0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
22 changes: 22 additions & 0 deletions _includes/build/best_practices_download_speed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div>
<h3>
Requesting compressed data
</h3>

<p>
Requesting compressed data can help increase your download speed. You can request compressed data files by specifying the `Accept-Encoding: gzip` header in your download requests.
</p>

<H4>
Sample cURL Command to Download the Data
</H4>
<pre><code>curl "https://sandbox.bcda.cms.gov/data/42/afd22dfa-c239-4063-8882-eb2712f9f638.ndjson" \
-H "Authorization: Bearer <span style="color: #046B99;">{access_token}</span>" \
-H "Accept-Encoding: gzip"
</code></pre>

<h3>
Downloading files concurrently
</h3>
<p>When multiple files are available, you don't need to wait for one download to complete before starting the next. You may make multiple download requests concurrently.</p>
</div>
4 changes: 2 additions & 2 deletions _includes/build/requesting_data_all_three.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ <h3 class="ds-c-alert__heading"> Files expire after 24 hours.</h3>
</div>

<p>
The "Accept-Encoding: gzip" header is optional, but will return a significantly smaller (40X smaller) file with a faster download speed. You will need to uncompress the file after downloading if you supply this header. When downloading multiple files, you can further speed up the process by downloading multiple files concurrently.
The "Accept-Encoding: gzip" header is optional, but will return a significantly smaller (about 30X smaller) file with a faster download speed. Follow our recommended best practices for <a href="#speeding-up-downloads" class="in-text__link">speeding up downloads</a>.
</p>
<p>
The response will be the requested data as FHIR resources in NDJSON format. Each file related to a different resource type will appear separately and labeled as to which resource type it contains. Examples of data from each Resource Type are available in the guide to working with BCDA data.
The response will be the requested data as FHIR resources in NDJSON format. Each file related to a different resource type will appear separately and labeled as to which resource type it contains. Examples of data from each Resource Type are available in the guide to working with BCDA data.
</p>
15 changes: 15 additions & 0 deletions build.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
</a>
</li>
</ul>
<ul class="ds-c-vertical-nav__subnav">
<li class="ds-c-vertical-nav__subnav">
<a class="ds-c-vertical-nav__label ds-c-vertical-nav__label" href="#speeding-up-downloads">
Speeding up downloads
</a>
</li>
</ul>
</li>
</ul>
</aside>
Expand Down Expand Up @@ -258,6 +265,14 @@ <h2>
{% include build/best_practices_429.html %}
</div>
</div>
<div id="speeding-up-downloads">
<h2>
Speeding up downloads
</h2>
<div class="ds-u-font-size--base">
{% include build/best_practices_download_speed.html %}
</div>
</div>
</div>
</main>
</div>
Expand Down

0 comments on commit b1127b0

Please sign in to comment.