I wonder if there’s some negative implications using .compute
in a regular product route, for example something like this
.get('/products/:slug*', res => {
res.compute(req => {
const destination = getDestination(req.path);
if (destination) {
// if there's some redirect found for this page, do it
res.cache({ edge: { maxAgeSeconds: FAR_FUTURE_TTL } });
return res.redirect(
destination,
301
);
} else {
// otherwise just render PDP
res.cache(HTML);
renderNuxtPage(res);
}
});
})
this code works, but I’m not sure if this is the best way to handle some specific product redirects.
Thanks!