Using a Content Delivery Network (CDN)¶
A Content Delivery Network is a distributed network of servers that can deliver static content to users around the world.
When to use a CDN?¶
Large Media Files: PhotoPrism stores photos and videos that can be very large. A CDN can help speed up the delivery of these files to users.
Global Audience: If your PhotoPrism instance is accessed from different locations around the world, a CDN can help reduce latency and improve the overall user experience by delivering content from servers that are closer to your users.
Many Users: If your PhotoPrism instance is getting a lot of traffic, a CDN can improve application performance by reducing the load on your server.
You can use the following config options to specify the URL of an external CDN and change the cache expiration time for thumbnails and other static content:
|content delivery network
|stream videos over the specified CDN
|HTTP Content-Security-Policy (CSP)
|allow static content to be cached by a CDN or caching proxy
SECONDS until cached content expires
SECONDS until cached videos expire
If you don't have a CDN provider yet, we can recommend bunny.net. This EU-based company has a cute name, but is a reputable provider with excellent performance, a wide range of features, and more than 20,000 customers including big names like Hyundai. We also chose bunny.net for our website and public demo as they are fully compliant with the GDPR.1
Pricing starts at $0.005/GB and there is no minimum usage or monthly fee, so you only pay for what you actually need.
Cloudflare works similarly to a reverse proxy and allows you to make a private server publicly accessible over the Internet. This means that users accessing your instance through their service will only see a single URL as if they were connecting directly.
You must therefore not configure a CDN URL for your site, as this may prevent the user interface from loading. Also note that their free tier does not include video streaming, so there may be problems with video playback if you are not a paying customer.
We receive a $20 credit when you sign up through our link, which helps us fund the project infrastructure. ↩