@@ -318,6 +318,22 @@ following valid forms:
318318* An arbitrary URL to a Python package: ` "https://.../package.whl" `
319319* A file copied onto the browser based file system: ` "emfs://.../package.whl" `
320320
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+
321337### Plugins
322338
323339The ` plugins ` option allows user to either augment, or exclude, the list of
@@ -518,6 +534,32 @@ experimental_create_proxy = "auto"
518534 [raise an issue](https://github.com/pyscript/pyscript/issues) with a
519535 reproducable example, and we'll investigate.
520536
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, ` window.my_object.foo.bar.baz ` causes a round-trip to
541+ the 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+ In this experimental phase, we suggest trying ` 0 ` , ` 30 ` or a value that won't
554+ likely bypass the browser rendering of 60fps. Of course, ` 1000 ` (i.e. a second)
555+ would be a fun, if greedy, experiment.
556+
557+ ### debug
558+
559+ When using Pyodide, if the ` debug ` setting is set to ` true ` , then Pyodide will
560+ run in debug mode. See Pyodide's documentation for details of what this
561+ entails.
562+
521563### Custom
522564
523565Sometimes plugins or apps need bespoke configuration options.
0 commit comments