Skip to content

Commit a48787a

Browse files
committed
fix: migrate to proper format
1 parent fafdabc commit a48787a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

static-assets.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
## Static assets
22

3-
For serving static resources we recomend using `express.static` middleware.
4-
Using express.static() method, you can server static resources directly by specifying the folder name where you have stored your static resources.
5-
Documentation for the middleware can be found in:
3+
## Recommended packages
4+
5+
* [express-static](https://expressjs.com/en/starter/static-files.html).
6+
Express static is part of the express.js package that allows evelopers to expose static middlewares.
7+
8+
## Guidance
69

10+
For serving static resources we recomend using `express.static` middleware as it has been widely used and tested in production.
11+
When using express.static() method, we can server static resources directly by specifying the folder name where we have stored our static resources.
12+
13+
Documentation for the middleware can be found in:
714
https://expressjs.com/en/starter/static-files.html
815

9-
## Caching
16+
### Caching
1017

11-
The static middleware does no server-side caching.
18+
The static middleware does server-side caching.
1219
It lets you do two methods of client-side caching: ETag and Max-Age
1320
If you configured your static middleware to use client side caching please make sure that
14-
every modification in your code is represented as different file name.
21+
every modification in your code will be creating resources with different file name.
1522

1623
When using bundlers you will explicitly need to generate different file names every time content changes.
1724
Example for webpack (most popular bundler) can be found here:

0 commit comments

Comments
 (0)