Closed StyleT closed 7 years ago
@StyleT Yeah its totally possible and you can mark the fragment that you want to control the status code of the page as primary
<fragment primary src="url.com"></fragment>
Not sure if this was your question..
and if you want to control the fragment fallback then you can also give the fallback-src
if its down.
@vigneshshanmugam problem here that header & footer fragments are not actually primary
fragments. primary
one in this theoretical setup with header, body & footer fragments is actually a body
.
And I can't use few primary fragments on the page.
Talking about fallback-src
. Great feature, but what if fallback is also broken?
This Should clarify the overall idea..
primary
fragment is down and doesn't have a fallback-src
then 500 status code is returned and none of the fragments are rendered. primary
fragment is down and it does have a fallback-src
then page will be rendered with 500 status code and fallback is fetchedfallback-src
is also down then status code will be still 500.. but the response is ignored.. all the other fragments are rendered as well. @vigneshshanmugam yep, got it. But what if I want to mark some fragments in such way so if some of them (and their fallbacks too) are down we should return some general error page instead of broken one?
@StyleT Hmm we haven't had/thought about this case.. Because we always serve the fallback-src
from a CDN ( static error html) for each fragment.. Worked always for us.. But would be happy to support it as well.
Doing the proposal that you are aiming for would require lots of bookkeeping and will need some tweaks in the way we compose streams!..
Having the fallback of the fallback doesn't make sense to me..
I agree with @w0rm on this and in the end you would need to fall back to a page when your primary/required fragment is not available which is already solved in tailor.
Having required is not in scope for now, Hence closing the issue
Hi! Is there any way to mark some fragments as "required" so if they return error code we should return some general error page instead of broken one? This can be useful in case we want to show "Server error page" if server that server our header & footer is unavailable.
P.S.: It this behaviour makes sense for you guys I can help with a PR.