Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Build ESI onerror and alt support into 404 handler? #83

Closed
trieloff opened this issue May 13, 2019 · 4 comments
Closed

Build ESI onerror and alt support into 404 handler? #83

trieloff opened this issue May 13, 2019 · 4 comments
Labels
question Further information is requested

Comments

@trieloff
Copy link
Contributor

Give that we post-process most resources that could contain ESI anyway (in helix-pipeline or helix-static), it might be practical to implement support for the alt and onerror through rewritten ESI and modified VCL.

  1. <esi:include src="foo.html" alt="bar.html" /> becomes <esi:include src="foo.html?alt=bar.html"/>

When the 404 handler detects that this is an ESI request with an alt query string parameter, it will change the URL and restart the request.

  1. <esi:include src="foo.html" onerror="continue" /> becomes <esi include src="foo.html?onerror=continue"/>

When the 404 handler detects that this is an ESI request with the onerror request parameter, it handle the request depending on the value of the onerror request parameter:

  • continue: create an empty synthetic response
  • static: create a synthetic response that contains the current URL (slightly rewritten, so recreate the required fallback for static)

In all other cases, run the standard 404 behavior.

@trieloff trieloff added the question Further information is requested label May 13, 2019
@tripodsan
Copy link
Contributor

tripodsan commented May 13, 2019

what are the chances that fastly implements this in their ESI processing out-of-the-box?

I don't like that the control logic is done via request params. since fastly knows the esi include depth, it must keep a state. so it might be possible to use this somehow?

@trieloff
Copy link
Contributor Author

what are the chances that fastly implements this in their ESI processing out-of-the-box?

I'd say slim, but I can check.

@kptdobe
Copy link
Contributor

kptdobe commented Jun 4, 2019

@trieloff any update on this ?

@kptdobe
Copy link
Contributor

kptdobe commented Jun 6, 2019

FYI, I followed up on the Fastly slack channel. Waiting now for ideas from @drwilco ;)

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

No branches or pull requests

3 participants