New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return custom status code #347
Comments
We currently have the After a 4xx or 5xx response from your server, you would insert this meta tag into the The plugin I linked above looks for this meta tag after the page is done loading and then returns the status code found in the content property as the new status code. |
thanks, thoop, |
ok, this plugin works but with a slight problem(huge one, imho). Update
The reason for reporting the finding here is that the plugin above has disabled the "Issues" section. |
calling res.send with the result is fine. You don't want it to continue on and render the page again. You want it to end there while returning the cached page. It looks like the real issue is this line isn't checking for a status code. They are always just saving to the cache, no matter the status code. That's bad. Feel free to fork their code, check the status code, and send them a pull request! |
We have a single page app that connects to an api which may or may not respond, eg: could be down, the request object may be invalid, connectivity issues, etc. and we'd like to respond with a proper response code for those cases(4xx, 5xx) and not just a 200 and a page with important notifications/warning.
I think, this problem is very similar to
window.prerenderReady
, where the spa "notifies"the prerender server that the page is ready to be rendered.
At this moment, i can see only 2 options:
to
prerenderReady
, adding the proper status code to the response returned by prerenderI would very much like to use the second option but before jumping to various hacks and workarounds.
Thanks in advance!
The text was updated successfully, but these errors were encountered: