diff --git a/examples/v7-image-optimization/README.md b/examples/v7-image-optimization/README.md new file mode 100644 index 000000000..bc9d93a85 --- /dev/null +++ b/examples/v7-image-optimization/README.md @@ -0,0 +1,24 @@ +# Edgio Image Optimization Examples + +https://edgio-community-examples-v7-image-optimization-live.glb.edgio.link + +## Description + +Edgio's [image optimization](https://docs.edg.io/guides/v7/performance/image_optimization) feature can dynamically alter images to fit a site's design, experience, and performance needs, by applying transformations like resizing, blurring, or cropping based on the site's requirements. For instance, it can blur images beyond a visitor's free access limit on a paywalled site. It enhances performance by caching the transformed images at the network edge, reducing image processing time and delivering optimized images nearer to users. + +## Setup and Installation + +- Clone the repository to your local machine. +- Run `npm install` in the repository directory. + +## Getting Started + +After setting up the project, run `npm run edgio:dev` to start a local development server to test the example functions. + +To deploy the project to Edgio, use the command `npm run edgio:deploy`. Note that deployment to Edgio requires you to be +logged into Edgio CLI which can be done via `npm run edgio login` and following the instructions. + +## Support + +If you have any queries or face issues with this project, please don't hesitate to contact +the [Edgio team](https://edg.io/contact-support/). diff --git a/examples/v7-image-optimization/routes.js b/examples/v7-image-optimization/routes.js index 11b89bbf2..af48b2733 100644 --- a/examples/v7-image-optimization/routes.js +++ b/examples/v7-image-optimization/routes.js @@ -2,7 +2,11 @@ import { Router, edgioRoutes } from '@edgio/core'; export default new Router() .use(edgioRoutes) - + .always({ + caching: { + max_age: '1d', + }, + }) // example page for image optimization .match('/', { edge_function: 'edge-functions/main.js',