Skip to content

Use API routes for RSS feed#153

Merged
rosszurowski merged 2 commits intomainfrom
rosszurowski/rss
Mar 27, 2023
Merged

Use API routes for RSS feed#153
rosszurowski merged 2 commits intomainfrom
rosszurowski/rss

Conversation

@rosszurowski
Copy link
Contributor

This commit updates the RSS feeds to be generated at request time via an API route rather than at build time. I find this helps minimize the need for "post-build" steps and makes it easier to pull content from dynamic sources when working with Next.js.

Feel free to reject if you'd rather keep doing it at build time.

@vercel
Copy link

vercel bot commented Mar 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
tailscale-dev ✅ Ready (Inspect) Visit Preview Mar 24, 2023 at 3:21PM (UTC)

return new Response(feed, {
headers: {
'Content-Type': 'application/xml',
'Cache-Control': 'public, s-maxage=1200, stale-while-revalidate=600',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These cache values may need to be changed depending on what makes sense for the site.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems sensible to me.

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

This commit updates the RSS feeds to be generated at request time via
an API route rather than at build time. I find this helps minimize the
need for "post-build" steps and makes it easier to pull content from
dynamic sources when working with Next.js.
@rosszurowski
Copy link
Contributor Author

Just rebased against main. I'll merge once tests pass.

Signed-off-by: Tyler Smalley <tyler@tailscale.com>
@rosszurowski rosszurowski merged commit 2d1120d into main Mar 27, 2023
@rosszurowski rosszurowski deleted the rosszurowski/rss branch March 27, 2023 15:46
shayne added a commit that referenced this pull request Mar 28, 2023
shayne added a commit that referenced this pull request Mar 28, 2023
@shayne
Copy link
Contributor

shayne commented Mar 28, 2023

I had to revert this in #157 it was throwing a 500 when trying to access the RSS feed

tylersmalley added a commit that referenced this pull request Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants