Next.js Discord

Discord Forum

Setting http headers on Page routes

Unanswered
Glen of Imaal Terrier posted this in #help-forum
Open in Discord
Glen of Imaal TerrierOP
I have a page route ( using pages router), that calls an API endpoint with attributes of the route like uri parts ( slug ), country code etc. From the API response, I need to set a response http header with data from the response e.g. Set a Cache-Tag header with the value of article_id:<article-id from response >. Its not possible to set to set headers in page.tsx, is there a workaround of how to set a http response header in this situation.

Thanks in advance

0 Replies