Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweak committed Sep 12, 2022
1 parent 3a7ae69 commit 336df7e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/middlewares.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
-
name: Build go-esi as caddy module
run: cd middlewares/caddy && xcaddy build --with github.com/darkweak/go-esi/middleware/caddy=./ --with github.com/darkweak/go-esi@latest=../..
run: cd middleware/caddy && xcaddy build --with github.com/darkweak/go-esi/middleware/caddy=./ --with github.com/darkweak/go-esi@latest=../..
-
name: Run Caddy tests
run: cd middlewares/caddy && go test -v ./...
run: cd middleware/caddy && go test -v ./...
-
name: Run detached caddy
run: cd middlewares/caddy && ./caddy run &
run: cd middleware/caddy && ./caddy run &
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ go-esi

go-esi is the implementation of the non-standard ESI (Edge-Side-Include) specification from the w3. With that you'll be able to use the ESI tags and process them in your favorite golang servers.

## What are the ESI tags
The ESI tags were introduced by Akamai to add some dynamic tags and only re-render these parts on the server-side.
The goal of that is to render only specific parts. For example, we want to render a full e-commerce webpage but only the cart is user-dependent. So we could render the "static" parts and store with a predefined TTL (e.g. 60 minutes), and only the cart would be requested to render the block.

There are multiple `esi` tags that we can use but the most used is the `esi:include` because that's the one to request another resource.

We can have many `esi:include` tags in a single response, and each `esi:include` tags can itself have one or more `esi:include` tags.
![esi page example](https://github.com/darkweak/go-esi/blob/master/docs/esi_2.jpg?sanitize=true)

We can have multiple `esi:include` tags in the page to request another resource and add its content to the main page.
![esi process example](https://github.com/darkweak/go-esi/blob/master/docs/esi_1.jpg?sanitize=true)

## References
https://www.w3.org/TR/esi-lang/

Expand Down
Binary file added docs/esi_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/esi_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 336df7e

Please sign in to comment.