Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Add support for esi onerror flags #217

Open
tripodsan opened this issue May 13, 2019 · 4 comments
Open

Add support for esi onerror flags #217

tripodsan opened this issue May 13, 2019 · 4 comments

Comments

@tripodsan
Copy link
Contributor

tripodsan commented May 13, 2019

the esi specification allows to specify a onerror attribute, which controls how the system should behave in case the resource doesn't exist:

If an ESI Processor can fetch neither the src nor the alt, it returns a HTTP status code greater than 400 with an error message, unless the onerror attribute is present. If it is, and onerror="continue" is specified, ESI Processors will delete the include element silently.

so the default behaviour is to respond with an error unless the attribute is onerror="continue" is present.

the current esi in the simulator implementation ignores errors when fetching the include content failed; where as the esi processor in fastly includes the response.body from the 404.

@trieloff
Copy link
Contributor

I can only speak for Fastly, which does not implement onerror and includes the 404 error page as is.

@tripodsan
Copy link
Contributor Author

I can only speak for Fastly, which does not implement onerror and includes the 404 error page as is.

yes, I saw this...this is a bit a bummer.

@kptdobe
Copy link
Contributor

kptdobe commented May 13, 2019

this is a bit a bummer.

I think this is much more: this makes ESI almost useless in our case. Since any request could return a 404 because corresponding content may not exist, having the "404 error page" inside the caller page makes it unusable.

@tripodsan
Copy link
Contributor Author

Since any request could return a 404 because corresponding content may not exist, having the "404 error page" inside the caller page makes it unusable.

we could tag the esi includes with ?x-esi=true or something and then ensure that fastly strips out any body for a 404. or we talk to fastly about this...

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

No branches or pull requests

3 participants