@@ -318,6 +318,22 @@ following valid forms:
318
318
* An arbitrary URL to a Python package: ` "https://.../package.whl" `
319
319
* A file copied onto the browser based file system: ` "emfs://.../package.whl" `
320
320
321
+ #### Package Cache
322
+
323
+ For performance reasons, PyScript caches packages so that a delay resulting
324
+ from downloading the packages is only noticable on first load - after which,
325
+ PyScript will fall back on packages previously downloaded and held in the
326
+ browser's local cache.
327
+
328
+ The behaviour of caching can be configured via the ` packages_cache ` setting. If
329
+ this setting is not used, PyScript will cache packages. Otherwise, override
330
+ PyScript's behaviour by setting ` packages_cache ` to one of these two values:
331
+
332
+ * ` never ` - PyScript will not cache packages.
333
+ * ` passthrough ` - this only works with Pyodide (see [ this wiki] ( https://deepwiki.com/cloudflare/pyodide/3-package-system ) ),
334
+ and will cause Pyodide to download packages in a parallel manner rather than
335
+ the default linear fashion. However, these packages will not be cached.
336
+
321
337
### Plugins
322
338
323
339
The ` plugins ` option allows user to either augment, or exclude, the list of
@@ -518,6 +534,28 @@ experimental_create_proxy = "auto"
518
534
[raise an issue](https://github.com/pyscript/pyscript/issues) with a
519
535
reproducable example, and we'll investigate.
520
536
537
+ ### experimental_ffi_timeout
538
+
539
+ When bootstrapping a worker, the worker is told to use a cache for round-trip
540
+ operations (for example, ` my_object.foo.bar.baz ` causes a round-trip to the
541
+ main thread for each dot ` . ` in this chain of references). By caching the
542
+ dotted references performance can be improved by reducing the number of
543
+ round trips PyScript makes.
544
+
545
+ However, not everything can be cached (those APIs or objects with side-effects
546
+ won't work; for example DOM element based APIs etc).
547
+
548
+ The ` experimental_ffi_timeout ` setting defines the maximum lifetime of that
549
+ cache. If it's less than 0 (the default), there is no cache whatsoever. Zero
550
+ means to clean up the cache on the next iteration of the event loop. A positive
551
+ number is the maximum number of milliseconds the cache will be kept alive.
552
+
553
+ ### debug
554
+
555
+ When using Pyodide, if the ` debug ` setting is set to ` true ` , then Pyodide will
556
+ run in debug mode. See Pyodide's documentation for details of what this
557
+ entails.
558
+
521
559
### Custom
522
560
523
561
Sometimes plugins or apps need bespoke configuration options.
0 commit comments