Comments (2)
Additionally, it would be nice if I can use the same blob storage for cached images.
from photosauce.
Using a remote file store is possible if you implement a VirtualPathProvider. There is a CachingAsyncVirtualPathProvider
base class defined in WebRSize that takes care of most of the details. I don't have any samples, but the code is not difficult to follow.
You would override the IsPathCaptured
method to designate a local path that is served from a remote location. You then provide overrides for FileExistsAsyncInternal
and GetFileAsyncInternal
so that WebRSize is able to check for the existence of a file and fetch it if necessary for processing.
There are a number of challenges with storing your images on remote storage, however. The main issue is speed (both latency and throughput). In order for WebRSize to know what size and format to serve and what processing is required, it needs to know some basic metadata from the header of the image. Checking for this metadata from a local file is very fast (<1 ms typically), whereas checking the metadata from a remote file will take hundreds to thousands of times as long. Similarly, when an image is needed for processing because the processed version is not already cached, that image must be downloaded from remote storage, which will be comparatively very slow. The download time will, in most cases, dwarf the processing time. For those reasons, it is preferable to cache files locally when they are sourced from remote storage so that subsequent processing requests for the same base image will be fast.
Storing the cached images on remote storage only exacerbates the problem, because checking to see if a cached image exists may take longer than processing a new one. The simple solution there is to use an edge-caching CDN, so it can serve the requests directly and only forward a request to your server when a new variant is needed.
from photosauce.
Related Issues (20)
- Orientation is not rotating properly HOT 1
- System.Runtime.InteropServices.COMException at PhotoSauce.MagicScaler.WicPlanarCache.loadBuffer
- Problem with certain PNG images HOT 8
- Transparent Color on PadTransform HOT 1
- RobiniaDocs API Explorer
- Update libwebp HOT 4
- Option to retain gif loop count when resizing HOT 6
- Could not load type 'PhotoSauce.MagicScaler.Converters.ChannelChanger`1' HOT 8
- ColorMatrixTransform does not unpremultiply/premultiply HOT 1
- Default JPEG encoding options are not publicly accessible HOT 4
- EncoderInfo not set correctly if output to Stream
- MagicScalar Linux issue
- libpng throws bad adaptive filter will abort writing result HOT 3
- libpng fails to convert several files that WIC can handle HOT 2
- `ArgumentOutOfRangeException` reading JPEG XL image from their test page HOT 3
- After update the solution to .NET 8 version the NativeCodecs dependency started to fail HOT 3
- Noob question: Having a hard time understanding the native codec binary build steps.
- How to gain best possible quality, disregard performance.
- IMultiFrameDecoderOptions support missing for JPEG XL HOT 1
- Decoder FrameRange validation is not valid HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photosauce.