SimpleCDN 0.8.0-rc4

This is a prerelease version of SimpleCDN.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SimpleCDN --version 0.8.0-rc4                
NuGet\Install-Package SimpleCDN -Version 0.8.0-rc4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleCDN" Version="0.8.0-rc4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleCDN --version 0.8.0-rc4                
#r "nuget: SimpleCDN, 0.8.0-rc4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SimpleCDN as a Cake Addin
#addin nuget:?package=SimpleCDN&version=0.8.0-rc4&prerelease

// Install SimpleCDN as a Cake Tool
#tool nuget:?package=SimpleCDN&version=0.8.0-rc4&prerelease                

alternate text is missing from this package README image SimpleCDN

SimpleCDN is one of the simplest and easiest-to-use CDN servers. To use it, simply add two lines of code to your startup code:

var cdnBuilder = builder.Services.AddSimpleCDN(options => options.DataRoot = "/var/static");

// ...

app.MapGroup("/cdn").MapSimpleCDN();

This will map the SimpleCDN endpoint to /cdn and serve files from /var/static.

Features

  • In-memory caching
  • Automatic compression (currently supported: gzip, deflate, brotli)
  • Redis caching for multiple instances or a cluster, with the SimpleCDN.Extensions.Redis package.

SimpleCDN is also available as a standalone application with a docker container: ghcr.io/jonathanbout/simplecdn

Configuration

General configuration

This configuration is for general settings for the CDN server.

var cdnBuilder = builder.Services.AddSimpleCDN(options => { ... });
// or
cdnBuilder.Configure(options => { ... });
  • options.DataRoot: The root directory to serve files from. This is a required property.
  • options.Footer: Set a custom footer for generated index pages. Default is Powered by SimpleCDN, with a link to the github repo.
  • options.PageTitle: Set a custom title for generated index pages. Default is SimpleCDN.
  • options.MaxCachedItemSize: The maximum size of a file to cache in kB, other files will be streamed directly from disk. Default is 8_000 (8MB).
  • options.AllowDotfileAccess: Whether to allow access to files starting with a dot. Default is false.
  • options.ShowDotFiles: Whether to show files starting with a dot. Default is false. If options.AllowDotfileAccess is false, this option is ignored.
  • options.BlockRobots: Whether to block robots from indexing the CDN. Default is true.

General caching configuration

This configuration is used by the Cache Manager and uses it to configure the caching provider.

cdnBuilder.ConfigureCaching(options => { ... });
  • options.MaxAge: The maximum time a file can be unused before it is removed from the cache, in minutes. Default is 60 (1 hour).

In-memory caching configuration

This configuration is used by the in-memory cache provider.

cdnBuilder.AddInMemoryCache(options => { ... });
  • options.MaxSize: The maximum size of the cache in kB. Default is 500_000 (500MB). When this limit is passed, the least recently used files are removed from the cache until the size is below the limit.
  • options.PurgeInterval: The interval at which the cache is purged of unused files, in minutes. Default is 5. Set to 0 to disable purging. Note that disabling purging means the MaxAge cache configuration property will not be respected.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SimpleCDN:

Package Downloads
SimpleCDN.Extensions.Redis

An extension for using Redis with SimpleCDN, the static file server.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.8.0 0 1/23/2025
0.8.0-rc7 0 1/23/2025
0.8.0-rc6 36 1/21/2025
0.8.0-rc5 28 1/17/2025
0.8.0-rc4 32 1/16/2025
0.8.0-rc3 29 1/15/2025
0.8.0-pre9 26 1/15/2025
0.8.0-pre8 25 1/15/2025
0.8.0-pre7 29 1/15/2025
0.8.0-pre6 21 1/14/2025
0.8.0-pre5 23 1/14/2025
0.8.0-pre4 32 1/11/2025
0.8.0-pre3 38 1/11/2025
0.8.0-pre11 29 1/17/2025
0.8.0-pre10 28 1/17/2025