SimpleCDN.Extensions.Redis
0.8.0-pre8
See the version list below for details.
dotnet add package SimpleCDN.Extensions.Redis --version 0.8.0-pre8
NuGet\Install-Package SimpleCDN.Extensions.Redis -Version 0.8.0-pre8
<PackageReference Include="SimpleCDN.Extensions.Redis" Version="0.8.0-pre8" />
<PackageVersion Include="SimpleCDN.Extensions.Redis" Version="0.8.0-pre8" />
<PackageReference Include="SimpleCDN.Extensions.Redis" />
paket add SimpleCDN.Extensions.Redis --version 0.8.0-pre8
#r "nuget: SimpleCDN.Extensions.Redis, 0.8.0-pre8"
#:package SimpleCDN.Extensions.Redis@0.8.0-pre8
#addin nuget:?package=SimpleCDN.Extensions.Redis&version=0.8.0-pre8&prerelease
#tool nuget:?package=SimpleCDN.Extensions.Redis&version=0.8.0-pre8&prerelease
SimpleCDN
SimpleCDN is, well, a simple CDN server. Currently it is only tested for single-instance use, but I don't see any reasons why a load balancer wouldn't work. With Redis you can make sure they have one single shared cache.
How to use this in an existing project?
NuGet Packages
SimpleCDN is available on NuGet:
How to use SimpleCDN as a standalone application?
Using Docker
Tags:
latest
: the latest stable releasemain
: the latest build of the main branch, usually on the last commit. Not recommended for production as it may contain bugs or break.vX.X.X
: pin to a specific version. Recommended for production scenarios. Supported versions can be found in the tags listing.
with docker run
docker run -p "<your_port>:8080" -v "<your_cdn_data>:/data:ro" ghcr.io/jonathanbout/simplecdn
This will pull and run the latest stable build of SimpleCDN.
with docker compose
services:
server:
image: ghcr.io/jonathanbout/simplecdn
volumes:
- <your_cdn_data>:/data:ro # :ro to make the bind mount read-only
ports:
- <your_port>:8080
environment:
- ASPNETCORE_URLS=http://+:8080
# === use below only if you want to use redis ===
- Cache__Redis__ConnectionString=redis:6379
redis:
image: redis
Redis support is available, but it ocasionally fails, especially in high-load scenario's. By implementing a custom connection manager, it's brought down to a minimum but failures still happen. The application will simply load the data from disk instead of using the cache.
Using dotnet
dotnet run
# PublishAOT is not supported with dotnet run so we need to disable it
dotnet run --property:PublishAot=false -- --data-root <your_cdn_data>
Variables:
Command line arguments have precedence over appsettings.json and appsettings.json has precedence environment variables.
command line argument | environment variable | appsettings.json | allowed values | default value | description |
---|---|---|---|---|---|
--data-root |
CDN_DATA_ROOT |
CDN:DataRoot |
a local path | /data |
The data root, where the files to be served are stored. |
--max-cache |
CDN_CACHE_LIMIT |
CDN:MaxMemoryCacheSize |
any number within the size of your devices memory | 500 |
The maximum size of the cache, in kB |
--CDN:Footer |
CDN__Footer |
CDN:Footer |
Any HTML | Powered by SimpleCDN (with a link to this GitHub repo) |
The text to place at the bottom of generated index files |
--CDN:PageTitle |
CDN__PageTitle |
CDN:PageTitle |
Any <title> compatible string | SimpleCDN |
The text to display in the browser's title bar |
more options are available, for a full overview look at the models in the SimpleCDN/Configuration folder.
- For command line arguments, use
--<section name>:<property name> "<property value>"
(section separator is:
) - For environment variables, use
<section name>__<property name>=<property value>
(section separator is__
, double underscore) - In appsettings.json, use the following structure:
{ "<section name>": { "<property name>": "<property value>" } }
Where section name is one of the following:
CDN
- common CDN options corresponding to CDNConfiguration.csCache
- caching options corresponding to CacheConfiguration.csCache
>Redis
- Redis-specific options, corresponding to RedisCacheConfiguration.csCache
>InMemory
- Redis-specific options, corresponding to InMemoryCacheConfiguration.cs When any options in the Redis section are defined, SimpleCDN will assume you want to use Redis. To overwrite this, use theCache
>Type
property to useInMemory
or no (Disabled
) cache.
Development
Contributions are always welcome! Feel free to create an issue if you encounter problems. If you know a fix, a Pull Request is even better!
Building the docker image
Building a docker image can be done easily with docker build
:
docker build . -f SimpleCDN/Dockerfile -t simplecdn:local
Be aware the build context has to be the root of the repo, whilst the dockerfile is in the SimpleCDN folder.
Running tests
Executing the Unit tests can be done with just a single command:
dotnet test SimpleCDN.sln
This will run the NUnit tests in the SimpleCDN.Tests project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- SimpleCDN (>= 0.8.0-pre8)
- StackExchange.Redis (>= 2.8.24)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.5 | 183 | 8/26/2025 |
1.0.4 | 159 | 6/3/2025 |
1.0.3 | 129 | 5/2/2025 |
1.0.2 | 131 | 2/21/2025 |
1.0.1 | 117 | 2/11/2025 |
1.0.0 | 117 | 2/11/2025 |
0.9.0-pre1 | 96 | 1/29/2025 |
0.8.0 | 112 | 1/23/2025 |
0.8.0-rc7 | 95 | 1/23/2025 |
0.8.0-rc6 | 108 | 1/21/2025 |
0.8.0-rc5 | 89 | 1/17/2025 |
0.8.0-rc4 | 92 | 1/16/2025 |
0.8.0-rc3 | 83 | 1/15/2025 |
0.8.0-pre9 | 93 | 1/15/2025 |
0.8.0-pre8 | 87 | 1/15/2025 |
0.8.0-pre7 | 93 | 1/15/2025 |
0.8.0-pre6 | 84 | 1/14/2025 |
0.8.0-pre11 | 100 | 1/17/2025 |
0.8.0-pre10 | 89 | 1/17/2025 |
0.8.0-pre1 | 89 | 1/14/2025 |