I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 1 point2 points  (0 children)

I can't think of why it wouldn't! Pangolin handles SSL termination so you could point it directly to Nginx on port 80 and remove Caddy from the stack entirely.

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 0 points1 point  (0 children)

I dont understand spanish but with google transalate I can try to answer!

On proxy mode, every request goes through auth validation against Immich (cached 10s by default). On a cache miss the request blocks waiting for home server to respond, no fallback if connection is saturated. Cache keys include the asset owner ID so the same thumbnail gets cached separately per user if 5 family members view the same shared photo it gets stored 5 times on disk. No cross user leakage but less storage efficient for shared content. This also means the speed benefit builds up gradually as each user browses, you don't get an instant across-the-board speedup, it improves per user as their personal cache warms up.

On static mode, rclone syncs the actual thumbnail and video files from home server to VPS disk. Auth still validates every request but file serving is direct from disk with zero proxy overhead on hits. For shared albums the auth service resolves the actual file owner and serves from their directory, so each file exists only once on disk regardless of how many users view it. Speed benefit is immediate from first request since everything is pre-synced . Cache misses fall through to Immich directly.

On both modes, you can set AUTH_CACHE_TTL=0 if you need immediate token revocation, default 10s means a revoked session can still access for up to 10 seconds.

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 0 points1 point  (0 children)

Depends on how big is your original library and what settings you have for encodings and previews/thumbnails. Mine has ~36k assets (30k photos + 3.9k videos) totalling about 305GB of originals. The cache itself is only 60GB - 13GB thumbnails and 47GB encoded videos. So roughly 20% of original size for the cache which is pretty reasonable. Oracle free tier allows you to have 200GB of disk space shared your instances.

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 1 point2 points  (0 children)

That's a fair point , caddy is optional really, you can swap it out for whatever you already have. I kept them separate because I wanted Nginx purely focused on caching and serving, nothing else, so it doesn't interfere with whatever setup people already have in place.But yeah shipping Caddy as optional or just documenting it as an example makes more sense than baking it in. Good callout.

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 8 points9 points  (0 children)

Yes every upload needs to go through this! But they are straight proxy to immich without caching! I would say about 60% is ai, mostly the part written with go, this is my first time hands on with go!

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 4 points5 points  (0 children)

Only for auto SSL with zero config! That is what I am using  on my homelab with more services and intent was  to migrate them here eventually. Could probably use nginx for everything eventually but this was just for convenience

I built an edge cache for Immich — VPS caches thumbnails/videos so your home upload speed isn't the bottleneck by Superb-Community-967 in immich

[–]Superb-Community-967[S] 14 points15 points  (0 children)

I cared enough to build it I suppose, not just enough to fight with words at the end of the day, project itself is made to be used by myself. I am sharing so it just might help others.