serverless-image-handler icon indicating copy to clipboard operation
serverless-image-handler copied to clipboard

Improve first load response time

Open Livijn opened this issue 3 years ago • 5 comments

Whenever I load an image from a new region it takes about 2s to load. Is there a way to improve this somehow?

One idea I have is to just send a request to the URL from each region when a new image is uploaded. But then I need a proxy for each location. Or is there anyway to specify a header or smth to force a specific edge location in AWS?

Livijn avatar May 04 '22 19:05 Livijn

This is a function of how CloudFront works. CloudFront caches on a per region basis. We are researching Origin Shield to improve cache hit ratio. We will update this issue once we make a determination.

dougtoppin avatar Oct 31 '22 15:10 dougtoppin

Okay, sounds good. Thanks for your response :)

Livijn avatar Oct 31 '22 16:10 Livijn

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Jan 30 '23 00:01 github-actions[bot]

We use origin shield for over a year, does exactly what you ask for, caching in region

frankenbubble avatar Jun 07 '23 07:06 frankenbubble

Hi @Livijn, As an update, we've decided to include this option as a Deployment Parameter, which will allow you to choose a region to enabled Origin Shield in (defaulting to disabled). We plan to have this released in the next major version of SIH.

Thanks for your interest in the Serverless Image Handler :) Simon

simonkrol avatar Mar 19 '24 15:03 simonkrol