-
-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
Labels
Description
Description
This issue is designed to capture the architecture and tasks required to build an extensible library for parsing URL API instructions and caching the result.
Feel free to discuss below. We'll assign specific issues for functional components as we determine them.
Basic Requirements
- Asp.NET Core Middleware to capture valid requests
- Extensible configuration for Caching, ImageServices, and Processing. Must be secure.
-
IImageServiceimplementations for physical file system and remote images. -
IDistributedCacheimplementation for physical file system that can be switched out for Redis, Azure, etc. How do we handle cleanup, Response codes? - Fast, low collision hashing of URL for cache implementations.
Pipeline
The following gives an overall summary of the image processing pipeline.
- Request is intercepted by Middleware (Authorisation?)
IImageServiceis assigned using URL prefix pattern matching (Regex?)IImageServicedetermines validity of request and attempts to return stream containing image.IDistributedCacheimplementation checks if file exists. (Redirect if exists?)- Not cached? URL querystring params are parsed for matching processor.
- Image is processed by matches via fluent API.
- Result is cached and image served.
- Cleanup of expired cached files. (How?, When?)
Edit
Updated Requirements and Pipeline below
Basic Requirements
- Asp.NET Core Middleware to capture valid requests
- Extensible configuration for Parsing, Resolving, Processing, and Caching. Must be secure
- Configuration for handling EXIF metadata
-
IUriParserimplementation for parsing URI requests for command string that can be switched out -
IImageResolverimplementation collection for physical file system that - Extensible
CommandParserimplementation for converting commands into real values for processing. -
IImageWebProcessorfor Resize -
IImageWebProcessorfor Quality -
IImageWebProcessorfor Format -
IImageWebProcessorfor BackgroundColor -
IImageCacheimplementation for physical file system that can be switched out for Azure, etc. - Fast, low collision hashing of URL for cache implementations
-
ILoggerbased logging -
TagHelperfor generatingimg,picturemarkup
Pipeline
The following gives an overall summary of the image processing pipeline.
- Request is intercepted by Middleware
IUriParserextracts commands; if not found, exitIImageResolveris assigned usingMatch()methodIImageResolverdetermines validity of request and attempts to return stream containing image.IImageCacheimplementation checks if file exists. (Returns correct response)- Not cached? URL querystring params are parsed for matching processor.
IImageWebProcessorimplementations process the image- Result is cached and image served.