Skip to content

Commit 7fc8c8a

Browse files
committed
Update configuration as discussed.
1 parent 48a0db8 commit 7fc8c8a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/user-guide/configuration.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

323339
The `plugins` option allows user to either augment, or exclude, the list of
@@ -518,6 +534,28 @@ 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, `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+
521559
### Custom
522560

523561
Sometimes plugins or apps need bespoke configuration options.

0 commit comments

Comments
 (0)