From 544d7b832e615974ea2bab104697170f0656c201 Mon Sep 17 00:00:00 2001 From: Oshani Weerakoon <oshani.s.weerakoon@utu.fi> Date: Wed, 8 Nov 2023 21:54:38 +0200 Subject: [PATCH] Updated instructions on caching images --- Code-examples/Ex12/Instructions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code-examples/Ex12/Instructions.md b/Code-examples/Ex12/Instructions.md index 8a7faff..cb0d3c9 100644 --- a/Code-examples/Ex12/Instructions.md +++ b/Code-examples/Ex12/Instructions.md @@ -1,4 +1,4 @@ -We'll use the `sharp` library to dynamically reduce the quality of images when they are requested. +We will use the `sharp` library to dynamically reduce the quality of images when they are requested. **Backend Setup:** @@ -72,4 +72,6 @@ You can test the endpoint using a web browser by navigating to `http://localhost The browser should display the image that has been processed by the `sharp` library to reduce its quality, thus reducing the size of the data transfer. +Note: In a real-world scenario, you would likely want to implement additional features, such as caching the processed images to avoid reprocessing them on each request, handling different image formats, and possibly providing different levels of quality based on user preferences or network conditions. + This example demonstrates how you can use server-side processing to reduce the quality of content before it is sent over the network, which can help in reducing the overall data transfer and contribute to green programming practices. \ No newline at end of file -- GitLab