I’ve got NextCloud successfully setup at home using the VM image from www.hanssonit.se. I’ve added an external SMB storage to my NAS. Works great! For now, I’m mostly interested in file sharing and syncing.
I already had nginx setup on a VPS proxying connections down a VPN tunnel back to another http service at home. So I decided to do the same with NC at home. It wasn’t tough to add this. Just tested it, works great!
What I really want to do is to have my VPS nginx cache a lot of my file content so I don’t have to keep getting thru the slow upload side of my home’s Internet connection. After the initial cache miss, the files will be in nginx’s cache. I’ve got caching setup in nginx and it is sort of working. The problem I’m having is that NC appears to set headers like:
cache-control: no-store, no-cache, must-revalidate
expires: Thu, 19 Nov 1981 08:52:00 GMT
for some responses I see:
cache-control: private
^^^^ this expires date is an indicator PHP’s session_cache_limiter() is being used. So I assume this is an intentional choice. I can understand the privacy stance on this, but it seems like many NextCloud installs would benefit from an trusted caching reverse-proxy running on a different machine.
I can ignore cache-control and expires headers with nginx config, but I’m concerned something will break, or that if I update the file contents, nginx won’t know to go ask NC is there is updated content.
Also, it looks like doing a direct download of a file, NC uses a downloadStartSecret=xxxxx
query param which by default makes nginx think it is different content. Again, I know how to get nginx to ignore this, but I’m concerned about side effects.
Is there support in NC for making static (or mostly static content like my files) more cacheable?