Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache server via slotlist.info domain #89

Open
4 tasks
MorpheusXAUT opened this issue Mar 14, 2018 · 3 comments
Open
4 tasks

Add cache server via slotlist.info domain #89

MorpheusXAUT opened this issue Mar 14, 2018 · 3 comments

Comments

@MorpheusXAUT
Copy link
Member

We're currently not utilising Cloudflare's caching at all since images are loaded directly from GCP storage (also resulting in higher bandwidth costs).
A solution to this (and future file hosting/static content caching) would be to add a cache server (most likely just a minimal nginx container) that proxies requests towards the appropriate GCP storage buckets. This would save external GCP bandwidth and allow for caching through Cloudflare.

Example: the mission image for Diyala Rumble is currently loaded from https://slotlist-info.storage.googleapis.com/images/uploads/missions/diyala-rumble/e643c149-53b1-4ce4-a8f2-32e47fd10e65. After the cache server introduction, the URL would be created as e.g. https://cdn.slotlist.info/images/missions/diyala-rumble/e643c149-53b1-4ce4-a8f2-32e47fd10e65. The nginx server listening to cdn.slotlist.info would the do a proxy_pass to slotlist-info.storage.googleapis.com and cache the image appropriately.


Tasks

  • Set up cache server (nginx)
  • Set up SSL certificate for cache server
  • Ensure correct proxying/routing for different image types
  • Rewrite all image URLs to use cache server
@regner
Copy link

regner commented Mar 14, 2018

I guess this entirely comes down to the number of assets and the usage, but did you consider the GCP CDN?

@MorpheusXAUT
Copy link
Member Author

For now, it's only approximately 50 images and usage is still pretty low, so it's probably not yet worth, although a valid suggestion!
Unfortunately, it looks like the GCP CDN doesn't work without a GCP loadbalancer, which would add another flat... 16€ or something on top of the current costs.

I'll see if the GCP -> nginx -> Cloudflare caching actually does anything, although with the rest of the k8s setup, it's mostly for experimenting, not so much due to an actual need 😄

Thanks for your suggestion though - was astonished to see an answer to one of my monologue-rambling issues 😛

@regner
Copy link

regner commented Mar 14, 2018

I probably pay way closer attention to this than I should :P

Do keep this updated with any testing you do though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants