Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Incorporate virtual user number into tile load cache busting
Browse files Browse the repository at this point in the history
Adding the VU index into the cache key attempts to simulate a tile fetching
situation that is a resource intensive as possible, where each batch of tile
requests from each parallel user always misses the cache.
  • Loading branch information
jwalgran committed Mar 24, 2022
1 parent 27def9e commit 0f3d366
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion load-tests/zoom_rio_de_janerio_with_contributor_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ har.log.entries.forEach((entry) => {
const cacheKey = crypto
.sha1(entry.request.url.match(pattern)[5], "hex")
.slice(0, 8);
// Including the __VU in the cache key should generate a worse situation
// than typical. Each batch of requests is made by a separate VU and when
// VU_MULTIPLIER is larger than 1, we repeat the same batch ofrequests a
// number of times equal to VU_MULTIPLIER. Using __VU in the cache key means
// subsequent requests for the same batch will not hit the cache.
const url = entry.request.url.replace(
pattern,
`${cacheKey}${__ENV.CACHE_KEY_SUFFIX}/$2/$3/$4.pbf?$5`
`${cacheKey}-vu-${__VU}-${__ENV.CACHE_KEY_SUFFIX}/$2/$3/$4.pbf?$5`
);

const referer = entry.request.headers.find(
Expand Down

0 comments on commit 0f3d366

Please sign in to comment.