jdecool/scaleway-runtimepublic Fork
⑂ c9280af
Commits
⬇ Clone ▾
git clone https://git.rickub.com/jdecool/scaleway-runtime.git
git clone ssh://git@rickub.com/jdecool/scaleway-runtime.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

docs: decide that the function serves Static Files itselfUnverified

Jérémy DECOOL committed 2026-11-22T11:45:16+01:00 Browse files
c9280af parent: fcb9afc
modified GLOSSARY.md +4 -0
@@ -49,3 +49,7 @@ _Avoid_: Token, API key
4949 **Emulator**:
5050 The local server that turns real HTTP requests into Events and calls the Handler, to run an application without deploying it.
5151 _Avoid_: Local runtime, dev server
52+
53+**Static File**:
54+A file present under the application's web root when an HTTP Invocation asks for it, answered as it is, without building the Application.
55+_Avoid_: Asset (the Symfony component), public file
@@ -49,3 +49,7 @@ _Avoid_: Token, API key
49 **Emulator**:49 **Emulator**:
50 The local server that turns real HTTP requests into Events and calls the Handler, to run an application without deploying it.50 The local server that turns real HTTP requests into Events and calls the Handler, to run an application without deploying it.
51 _Avoid_: Local runtime, dev server51 _Avoid_: Local runtime, dev server
52+
53+**Static File**:
54+A file present under the application's web root when an HTTP Invocation asks for it, answered as it is, without building the Application.
55+_Avoid_: Asset (the Symfony component), public file
added docs/adr/0009-serve-static-files-from-the-function.md +16 -0
new file mode 100644
@@ -0,0 +1,16 @@
1+# The function serves Static Files itself
2+
3+A Symfony application ships its CSS, JavaScript, images and fonts under its web root, and nothing in front of a Scaleway function serves them: every request reaches the Handler.
4+We therefore let the runtime serve the files under the web root itself, before building the Application, so that a standard application works on Scaleway without extra infrastructure, and keep moving them to Object Storage as a later, optional step.
5+
6+## Considered Options
7+
8+- Uploading them to Object Storage, behind Edge Services or not, and pointing `asset()` to it: kept for later, as it needs a bucket, CORS settings and a deployment step before an application works at all.
9+- Serving nothing and documenting Object Storage only: rejected, an unchanged application would answer its own stylesheets with 404s.
10+
11+## Consequences
12+
13+- Each Static File costs an Invocation, can hit a cold start, and its binary body grows by about a third once base64-encoded.
14+- Its size is bounded by the largest Function Response the platform accepts.
15+- Files written at runtime, such as user uploads, are only served by the instance that wrote them, each instance having its own ephemeral disk: they belong in Object Storage.
16+- Only a file that a `manifest.json` above it maps from another name, as AssetMapper and Webpack Encore write them, is cached for good: a digest guessed from the name alone would also match plain names such as `font-awesome.css`, which would then stay stale in browsers for a year.
new file mode 100644
@@ -0,0 +1,16 @@
1+# The function serves Static Files itself
2+
3+A Symfony application ships its CSS, JavaScript, images and fonts under its web root, and nothing in front of a Scaleway function serves them: every request reaches the Handler.
4+We therefore let the runtime serve the files under the web root itself, before building the Application, so that a standard application works on Scaleway without extra infrastructure, and keep moving them to Object Storage as a later, optional step.
5+
6+## Considered Options
7+
8+- Uploading them to Object Storage, behind Edge Services or not, and pointing `asset()` to it: kept for later, as it needs a bucket, CORS settings and a deployment step before an application works at all.
9+- Serving nothing and documenting Object Storage only: rejected, an unchanged application would answer its own stylesheets with 404s.
10+
11+## Consequences
12+
13+- Each Static File costs an Invocation, can hit a cold start, and its binary body grows by about a third once base64-encoded.
14+- Its size is bounded by the largest Function Response the platform accepts.
15+- Files written at runtime, such as user uploads, are only served by the instance that wrote them, each instance having its own ephemeral disk: they belong in Object Storage.
16+- Only a file that a `manifest.json` above it maps from another name, as AssetMapper and Webpack Encore write them, is cached for good: a digest guessed from the name alone would also match plain names such as `font-awesome.css`, which would then stay stale in browsers for a year.