hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT]: Implement Image Caching #252

Closed nadduli closed 1 month ago

nadduli commented 1 month ago

Description

Implement an image caching system with authentication, utilizing slugs for image access.

Acceptance Criteria

Purpose

Provides a backend service to cache images, ensuring efficient retrieval and access control through authentication. Utilizing slugs enhances the readability and usability of the URLs.

Requirements

Expected Outcome

Testing

Example Request

GET /api/v1/images/sample-image-slug
Authorization: Bearer <token>

Example Response

thenoblet commented 1 month ago

This looks good @nadduli. Great way to break what I did here on issue #247 into separate APIs. This would mean that the image upload endpoint must return a slug that uniquely identifies the image. Then save the image to a specific directory on the server using the slug as the filename.

Let's discuss the slug generation technique and other details when Mark approves this and the other.

markessien commented 1 month ago

this does not describe how the cache would work, in particular how it would integrate with nginx to serve cached images