4 ms·
So if I want to hook into each 4 parts of the lifecycle, I configure that and it gets executed once? Can I maintain state between inbound request->origin reque
by nhoughto 6y ago
So if I want to hook into each 4 parts of the lifecycle, I configure that and it gets executed once?
Can I maintain state between inbound request->origin request->origin response->inbound response?
My understanding was you can’t and it got called 4 times with different events, workers solves this by you being responsible for making the origin request (there is a simple mode where it does it for you to) with promises to manage origin response and inbound response logic.. I thought lambda@edge didn’t work like that?
- helsinkiandrew 6y agoFor each lambda function you specify which one of the 4 places it is called. So effectively be 4 different lambda functions, triggered independently (they could ofcourse share code). If you wanted to maintain state then I'd guess the easiest (only?) way is for the function to add headers to the HTTP request/response as it passed through.