A Fastly Compute@Edge service that renders externally hosted Markdown files. https://markdown-at-edge.edgecompute.app/
Go to file
Leonora Tindall 3f008be16c Include header and footer, and nginx config. 2022-09-20 11:44:33 -05:00
.cargo Initial working setup. 2022-09-19 09:56:48 -05:00
content Include header and footer, and nginx config. 2022-09-20 11:44:33 -05:00
src Support images and embeds properly. 2022-09-20 11:44:20 -05:00
.gitignore Initial working setup. 2022-09-19 09:56:48 -05:00
Cargo.lock Initial working setup. 2022-09-19 09:56:48 -05:00
Cargo.toml Initial working setup. 2022-09-19 09:56:48 -05:00
README.md Include header and footer, and nginx config. 2022-09-20 11:44:33 -05:00
fastly.toml Initial working setup. 2022-09-19 09:56:48 -05:00
rust-toolchain.toml Initial working setup. 2022-09-19 09:56:48 -05:00

README.md

Markdown@Edge

A Markdown renderer on the Compute@Edge platform from Fastly.

The main source file, src/main.rs, contains all the code for the renderer. The header and footer files I use are included at content/_header.md and content/_footer.md for easy inspection.

Nginx Configuration

In order to best support this application, it's important to add the following line to Nginx's MIME types configuration:

text/markdown     md;

I also disabled gzip and set the max-age and cache-control headers as follows:

server {
  # ...
  location /edgeblog {
    # To illustrate the source to visitors.
    autoindex on;
    autoindex_exact_size off;
    autoindex_format html;
    autoindex_localtime on;

    # To facilitate tagging.
    gzip off;

    # Cache-Control headers
    expires 1h;
    add_header Cache-Control "public";
  }
}