From ae15bb72740000bd1ac563cf4a0f96d2e9c73d1f Mon Sep 17 00:00:00 2001 From: Alice Wyan <121136+wyan@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:03:41 +0200 Subject: [PATCH 1/3] Add browser cache explanation in samples.mdx Several users (including me) have been bitten by this, so it's perhaps worth mentioning in the docs that the strudel.json file gets cached by the browser and doesn't reload properly unless forced. --- website/src/pages/learn/samples.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/src/pages/learn/samples.mdx b/website/src/pages/learn/samples.mdx index 890de3aae..88a0a3b29 100644 --- a/website/src/pages/learn/samples.mdx +++ b/website/src/pages/learn/samples.mdx @@ -163,6 +163,12 @@ The last section could be written as: } ``` +Please note that browsers will often cache `strudel.json` on first load, and keep using the cached +version even if the orginal has been updated. If this bites you (for example while developing a new +sample pack), you can force the browser to download a new copy by i.e. changing capitalization of one +character in the URL, or by removing it from cache (deleting cache in browser Privacy settings, or from +the dev console if you're technically minded, or by using a cache deleting extension). + ## Github Shortcut Because loading samples from github is common, there is a shortcut: From 117cf7e18aa3e481ffde92964fc41df3439d83c7 Mon Sep 17 00:00:00 2001 From: Alice Wyan <121136+wyan@users.noreply.github.com> Date: Mon, 9 Jun 2025 19:45:21 +0200 Subject: [PATCH 2/3] Update samples.mdx --- website/src/pages/learn/samples.mdx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/website/src/pages/learn/samples.mdx b/website/src/pages/learn/samples.mdx index 88a0a3b29..bc6627d29 100644 --- a/website/src/pages/learn/samples.mdx +++ b/website/src/pages/learn/samples.mdx @@ -166,8 +166,15 @@ The last section could be written as: Please note that browsers will often cache `strudel.json` on first load, and keep using the cached version even if the orginal has been updated. If this bites you (for example while developing a new sample pack), you can force the browser to download a new copy by i.e. changing capitalization of one -character in the URL, or by removing it from cache (deleting cache in browser Privacy settings, or from -the dev console if you're technically minded, or by using a cache deleting extension). +character in the URL, or adding a URL attribute, such as: +```javascript +samples('https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/strudel.json?version=2') +``` +that gets ignored by GitHub (but changes the URL, forcing the browser to reload every time we increase +the version number). + +It is also possible, of course, to just remove it from cache (deleting cache in browser Privacy settings, +or from the dev console if you're technically minded, or by using a cache deleting extension). ## Github Shortcut From 1b7fbecf50c8385497005cd8c8df36bc004f8f0e Mon Sep 17 00:00:00 2001 From: Alice Wyan <121136+wyan@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:20:21 +0200 Subject: [PATCH 3/3] Fix style issue --- website/src/pages/learn/samples.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/src/pages/learn/samples.mdx b/website/src/pages/learn/samples.mdx index bc6627d29..daaecd06c 100644 --- a/website/src/pages/learn/samples.mdx +++ b/website/src/pages/learn/samples.mdx @@ -167,9 +167,11 @@ Please note that browsers will often cache `strudel.json` on first load, and kee version even if the orginal has been updated. If this bites you (for example while developing a new sample pack), you can force the browser to download a new copy by i.e. changing capitalization of one character in the URL, or adding a URL attribute, such as: + ```javascript -samples('https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/strudel.json?version=2') +samples('https://raw.githubusercontent.com/tidalcycles/Dirt-Samples/master/strudel.json?version=2'); ``` + that gets ignored by GitHub (but changes the URL, forcing the browser to reload every time we increase the version number).