You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDNs often have quirks in terms of how they forward requests to origins.
When customers stack a CDN on MRT, we often debug request forwarding issues To debug issues with forwarding, we often suggest customers add an "echo" endpoint to ssr.js to their apps:
Sounds like a good idea. I'm wondering is something like this might be a little more future-proof.
// ssr.js
import {devMiddleware} from `pwa-kit-react-sdk`
...
if (!env.isProduction || env.enableServerDevEnpoint) {
app.use(devMiddleware())
}
Here we can add your suggested reflect endpoint under a common /__dev path. This would allow use to add more end-points with out worrying about coming up with pathnams that might collide with user defined ones. Another idea might be /__dev/info that would give the user and us details about the version of sdk/node/etc they are using.
@bendvc – your suggestion about not conflicting with existing customer routes is a good one!
Instead of introducing a new path, we could extend the current convention of /mobify/ping and friends with /mobify/reflect. Alternatively, we could even extend ping to conditionally provide this information.
One key part of my suggestion is that ideally this endpoint is available across all environments (including production ones!) and can be enabled without a code change – so I'm imagining something that is default off, but can be enabled using an MRT environment variable (eg. MRT_REFLECT_ENABLED=$TRUTHY)
CDNs often have quirks in terms of how they forward requests to origins.
When customers stack a CDN on MRT, we often debug request forwarding issues To debug issues with forwarding, we often suggest customers add an "echo" endpoint to
ssr.js
to their apps:It would be nice if we included this endpoint by default in apps with an environment variable toggle so folks could enable it without a code change.
This would simplify debugging many of these issues!
The text was updated successfully, but these errors were encountered: