Replies: 2 comments
-
Additionally, it would be nice if I can use the same blob storage for cached images. |
Beta Was this translation helpful? Give feedback.
-
Using a remote file store is possible if you implement a VirtualPathProvider. There is a You would override the 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. |
Beta Was this translation helpful? Give feedback.
-
In the configuration documents you say that an image folder is mandatory. Can we somehow leave the disk cache folder local and configure utilization of remote storage like Azure Blob Storage or any kind of CDN for image delivery?
If it is possible with the latest nuget release, what would the configuration look like? Basically what I want to achieve is something like this:
<img src="https://cdn.my.com/some/path/my-image?w=123" />
Thanks,
Drazen
Beta Was this translation helpful? Give feedback.
All reactions