pwa.mdx85 lines · 2.8 KB · raw
1---
2title: Offline
3layout: ../../layouts/MainLayout.astro
4---
5
6# Using Strudel Offline
7
8You can use Strudel even without a network! When you first visit the [Strudel REPL](https://strudel.cc/),
9your browser will download the whole web app including documentation.
10When the download is finished (<1MB), you can visit the website even when offline,
11getting the downloaded website instead of the online one.
12
13When the site gets updated, your browser will download that update on the next online visit.
14When an update is available, the site will refresh after the download is finished.
15
16This works because Strudel is implemented as progessive web app (using [Vite PWA](https://vite-pwa-org.netlify.app/)).
17
18## Samples
19
20While the browser will download the app itself, samples are only downloaded when you're actively using them.
21So to make sure a specific set of samples is available when offline, just use them.
22Also, only samples from these domains will be cached for offline use:
23
24- `https://raw.githubusercontent.com/*` for samples uploaded to github
25- `https://freesound.org/*` / `https://cdn.freesound.org/*` for freesound
26- `https://shabda.ndre.gr/.*` for shabda
27
28## Inspecting / Clearing Cache
29
30You can view all cached files in your browser.
31
32### Firefox
33
34- Open the Developer Tools (`Tools > Web Developer > Web Developer Tools`)
35- go to `Storage` tab and expand `Cache Storage > https://strudel.cc`.
36- or go to the `Application` tab and view the latest updates in `Service Workers`
37
38### Chromium based Browsers
39
40- Open Developer Tools (`Right Click > Inspect`)
41- go to the `Application` tab
42- view downloaded files under `Cache > Cache Storage`
43- view the latest updates in `Service Workers`
44
45## Strudel Standalone App
46
47You can also install Strudel as a standalone app on most devices.
48A standalone app has its own desktop / homescreen icon and launches in a separate window,
49without the browser ui.
50
51<figure>
52  ![Strudel on MacOS](/pwa/strudel-macos.png)
53  <figcaption>Strudel on MacOS</figcaption>
54</figure>
55
56### Desktop
57
58With a chromium based browser:
59
601. go to the [Strudel REPL](https://strudel.cc).
612. on the right of the adress bar, click `install Strudel REPL`
623. the REPL should now run as a standalone chromium app
63
64Without a chromium based browser, you can use [nativefier](https://github.com/nativefier/nativefier) to generate a desktop app:
65
661. make sure you have NodeJS installed
672. run `npx nativefier strudel.cc`
68
69<figure>
70  ![Strudel on Linux](/pwa/strudel-linux.png)
71  <figcaption>Strudel on Linux</figcaption>
72</figure>
73
74### iOS
75
761. open to the [Strudel REPL](https://strudel.cc/) in safari
772. press the share icon and tab `Add to homescreen`
783. You should now have a strudel app icon that opens the repl in full screen
79
80### Android
81
821. open to the [Strudel REPL](https://strudel.cc/)
832. Tab the install button at the bottom
84
85Ok, what are [Patterns](/technical-manual/patterns) all about?