Skip to content
Snippets Groups Projects
Commit 544d7b83 authored by Oshani Weerakoon's avatar Oshani Weerakoon
Browse files

Updated instructions on caching images

parent 088d0316
No related branches found
No related tags found
No related merge requests found
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:** **Backend Setup:**
...@@ -72,4 +72,6 @@ You can test the endpoint using a web browser by navigating to `http://localhost ...@@ -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. 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. 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment