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

feat: now the dev card page is cached for one hour #3968

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

nickytonline
Copy link
Member

@nickytonline nickytonline commented Aug 16, 2024

Description

Caches the dev card page for one hour. I haven't made it super long yet, as there's a mechanism we need to put in place for profile pages and this page which is leveraging Netlify's purge of cache keys.

That said, one hour is still solid and stale while revalidate is in place, so it should perform well. The only reason I put an hour is if the bio changes or other stats (related to purge mentioned above).

Deploy Preview compared to Beta App's dev card page

TLDR;

With caching:
Slowest: 2.6015 secs
Fastest: 0.0161 secs

Current Beta Site (no caching)
Slowest: 17.4056 secs
Fastest: 4.4655 secs

❯ oha --no-tui https://deploy-preview-3968--design-insights.netlify.app/u/nickytonline/card
Summary:
  Success rate: 100.00%
  Total:        2.6018 secs
  Slowest:      2.6015 secs
  Fastest:      0.0161 secs
  Average:      0.5719 secs
  Requests/sec: 76.8685

  Total data:   246.62 KiB
  Size/request: 1.23 KiB
  Size/sec:     94.79 KiB

Response time histogram:
  0.016 [1]   |
  0.275 [149] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.533 [0]   |
  0.792 [0]   |
  1.050 [0]   |
  1.309 [0]   |
  1.567 [0]   |
  1.826 [0]   |
  2.084 [0]   |
  2.343 [44]  |■■■■■■■■■
  2.601 [6]   |■

Response time distribution:
  10.00% in 0.0210 secs
  25.00% in 0.0237 secs
  50.00% in 0.0278 secs
  75.00% in 2.1212 secs
  90.00% in 2.1522 secs
  95.00% in 2.2013 secs
  99.00% in 2.5579 secs
  99.90% in 2.6015 secs
  99.99% in 2.6015 secs


Details (average, fastest, slowest):
  DNS+dialup:   2.1375 secs, 2.0711 secs, 2.5820 secs
  DNS-lookup:   0.0001 secs, 0.0000 secs, 0.0005 secs

Status code distribution:
  [404] 200 responses

app on  nickytonline/cache-dev-card-page [$] via  v20.14.0 took 2s 
❯ oha --no-tui https://beta.app.opensauced.pizza/u/nickytonline/card                       

Summary:
  Success rate: 100.00%
  Total:        65.3256 secs
  Slowest:      17.4056 secs
  Fastest:      4.4655 secs
  Average:      14.8924 secs
  Requests/sec: 3.0616

  Total data:   97.55 KiB
  Size/request: 499 B
  Size/sec:     1.49 KiB

Response time histogram:
   4.466 [1]   |
   5.760 [1]   |
   7.054 [1]   |
   8.348 [0]   |
   9.642 [0]   |
  10.936 [33]  |■■■■■■■■■
  12.230 [4]   |■
  13.524 [1]   |
  14.818 [9]   |■■
  16.112 [39]  |■■■■■■■■■■■
  17.406 [111] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Response time distribution:
  10.00% in 10.7154 secs
  25.00% in 14.8360 secs
  50.00% in 16.2516 secs
  75.00% in 16.4123 secs
  90.00% in 16.7027 secs
  95.00% in 16.7680 secs
  99.00% in 17.2363 secs
  99.90% in 17.4056 secs
  99.99% in 17.4056 secs


Details (average, fastest, slowest):
  DNS+dialup:   2.1185 secs, 2.0498 secs, 2.5527 secs
  DNS-lookup:   0.0003 secs, 0.0000 secs, 0.0015 secs

Status code distribution:
  [502] 195 responses
  [200] 5 responses

Related Tickets & Documents

Close #3967

Mobile & Desktop Screenshots/Recordings

Steps to QA

  1. Visit a dev card page, e.g. /u/nickytonline/card
  2. the page loads with the user's card info.
  3. Visit another dev card page, e.g. /u/jpmcb/card
  4. the page loads with the other user's card info.

Tier (staff will fill in)

  • Tier 1
  • Tier 2
  • Tier 3
  • Tier 4

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for oss-insights ready!

Name Link
🔨 Latest commit 9548844
🔍 Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/66bf6a7cc532a90008660287
😎 Deploy Preview https://deploy-preview-3968--oss-insights.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for design-insights ready!

Name Link
🔨 Latest commit 9548844
🔍 Latest deploy log https://app.netlify.com/sites/design-insights/deploys/66bf6a7cb6f5fe0008960879
😎 Deploy Preview https://deploy-preview-3968--design-insights.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nickytonline nickytonline force-pushed the nickytonline/cache-dev-card-page branch from 4eadff5 to 9548844 Compare August 16, 2024 15:04
@nickytonline nickytonline changed the title feat: now the dev card page is cached for 30 minutes feat: now the dev card page is cached for one hour Aug 16, 2024
@nickytonline nickytonline requested a review from a team August 16, 2024 15:07
@nickytonline nickytonline added this pull request to the merge queue Aug 16, 2024
Merged via the queue into beta with commit d070065 Aug 16, 2024
49 checks passed
@nickytonline nickytonline deleted the nickytonline/cache-dev-card-page branch August 16, 2024 16:37
open-sauced bot pushed a commit that referenced this pull request Aug 16, 2024
## [2.58.0-beta.3](v2.58.0-beta.2...v2.58.0-beta.3) (2024-08-16)

### 🍕 Features

* now the dev card page is cached for one hour ([#3968](#3968)) ([d070065](d070065))
open-sauced bot pushed a commit that referenced this pull request Aug 16, 2024
## [2.58.0](v2.57.0...v2.58.0) (2024-08-16)

### 🐛 Bug Fixes

* better DevCard data fetching flow ([#3936](#3936)) ([a5371ee](a5371ee))

### 🍕 Features

* add button to copy DevCard image to clipboard ([#3943](#3943)) ([d15ea8c](d15ea8c))
* add redirect for oscr.me to DevCard ([#3973](#3973)) ([88853aa](88853aa))
* implemented utility function to copy an HTML element as an image to the clipboard ([#3963](#3963)) ([35a3ffe](35a3ffe))
* now the dev card page is cached for one hour ([#3968](#3968)) ([d070065](d070065))
@nickytonline
Copy link
Member Author

nickytonline commented Aug 16, 2024

TLDR in prod

Production (no caching dev card page)
Slowest: 20.1116 secs
Fastest: 4.1734 secs
Average: 14.5518 secs

Production (caching dev card page)
Slowest: 8.6726 secs
Fastest: 0.0591 secs
Average: 2.8283 secs

Production (no caching dev card page)

oha --no-tui https://app.opensauced.pizza/u/nickytonline/card                            
Summary:
  Success rate: 100.00%
  Total:        65.2750 secs
  Slowest:      20.1116 secs
  Fastest:      4.1734 secs
  Average:      14.5518 secs
  Requests/sec: 3.0640

  Total data:   308.39 KiB
  Size/request: 1.54 KiB
  Size/sec:     4.72 KiB

Response time histogram:
   4.173 [1]  |
   5.767 [1]  |
   7.361 [1]  |
   8.955 [1]  |
  10.549 [4]  |■
  12.142 [47] |■■■■■■■■■■■■■■■■■■
  13.736 [26] |■■■■■■■■■■
  15.330 [12] |■■■■
  16.924 [81] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  18.518 [5]  |■
  20.112 [21] |■■■■■■■■

Response time distribution:
  10.00% in 10.7409 secs
  25.00% in 11.9511 secs
  50.00% in 15.9991 secs
  75.00% in 16.3893 secs
  90.00% in 19.6481 secs
  95.00% in 19.9475 secs
  99.00% in 20.0530 secs
  99.90% in 20.1116 secs
  99.99% in 20.1116 secs


Details (average, fastest, slowest):
  DNS+dialup:   2.1186 secs, 2.0533 secs, 2.5430 secs
  DNS-lookup:   0.0001 secs, 0.0000 secs, 0.0004 secs

Status code distribution:
  [502] 182 responses
  [200] 18 responses

Prod (dev card with caching)

❯ oha --no-tui https://app.opensauced.pizza/u/nickytonline/card
Summary:
  Success rate: 100.00%
  Total:        11.8555 secs
  Slowest:      8.6726 secs
  Fastest:      0.0591 secs
  Average:      2.8283 secs
  Requests/sec: 16.8698

  Total data:   1.06 MiB
  Size/request: 5.45 KiB
  Size/sec:     91.98 KiB

Response time histogram:
  0.059 [1]   |
  0.920 [42]  |■■■■■■■■■■■■■
  1.782 [100] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2.643 [4]   |■
  3.505 [2]   |
  4.366 [1]   |
  5.227 [3]   |
  6.089 [1]   |
  6.950 [2]   |
  7.811 [5]   |■
  8.673 [39]  |■■■■■■■■■■■■

Response time distribution:
  10.00% in 0.5818 secs
  25.00% in 1.0299 secs
  50.00% in 1.2463 secs
  75.00% in 4.4452 secs
  90.00% in 8.4557 secs
  95.00% in 8.5052 secs
  99.00% in 8.5946 secs
  99.90% in 8.6726 secs
  99.99% in 8.6726 secs


Details (average, fastest, slowest):
  DNS+dialup:   2.1526 secs, 2.0857 secs, 2.5743 secs
  DNS-lookup:   0.0002 secs, 0.0000 secs, 0.0027 secs

Status code distribution:
  [200] 200 responses

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

Successfully merging this pull request may close these issues.

Feature: Cache the dev card page
3 participants