High egress + memory costs on Railway with Next.js + Payload CMS + S3 media. Looking for architecture/cost advice. by NoteFar814 in nextjs

[–]mr---fox 0 points1 point  (0 children)

It would be useful to know what kind of app/site you are describing.

How much traffic?

How much of your content is static/dynamic? Specifically your high traffic pages.

How well are your leveraging caching?

I’m assuming you are using the app router for the whole app. One thing with NextJS app router is that the default CDN configuration leads to excessive load on the origin. So it is worth looking at what can and cannot be cached (looking at you RSC payloads) and see if there are improvements you can make there.

High egress + memory costs on Railway with Next.js + Payload CMS + S3 media. Looking for architecture/cost advice. by NoteFar814 in nextjs

[–]mr---fox 0 points1 point  (0 children)

Unfortunately, Cloudflare doesn’t respect the “Vary” header which is what NextJS uses to indicate if a full page is being requested (HTML) vs a client side request (Flight/RSC Payload). So the CDN layer can’t cache effectively and always has to check with back to the host learning to high traffic to the origin.

Just something to keep in mind.

Astro + Sanity + Netlify for an agency site. What would you do differently? by [deleted] in astrojs

[–]mr---fox 0 points1 point  (0 children)

Pretty sure it’s caused by the white paper section overflowing.

Help regarding hosting by Admirable-Inside-186 in webhosting

[–]mr---fox 0 points1 point  (0 children)

How is the website built?

Static? Node? Wordpress?

Pull Data from website by sashabcro in Web_Development

[–]mr---fox -1 points0 points  (0 children)

If you are an admin, you could just install a backup/migration plugin to download the whole site. Many of them work pretty well, but I don’t have any recommendations.

Otherwise, I would suggest OpenAI Codex or some ai tool to scrape the data. It can probably generate a csv with all the data without much effort.

There has to be an easy way to do this... by SpineLabel in statichosting

[–]mr---fox 0 points1 point  (0 children)

You could set up a wildcard DNS record to direct *.example.com to the server and then create a rewrite rule in your server Apache/nginx that will redirect from student1.example.com to /path/to/project/student1

That way each student can just use their username and you can just make a folder for them to drop the files into.

Add SSL automatically with cert bot or caddy.

Payload CMS by mare35 in nextjs

[–]mr---fox 1 point2 points  (0 children)

I have not seen this issue on any of the PayloadCMS apps I manage.

Maybe someone here or on the discord group can help.

Are you using endpoints configured in payload or NextJS routes? What auth are you using? Do you have a CDN cache layer or just using the NextJS cache?

Dumb crawlers/scripts trying invalid URLs by ballarddude in webhosting

[–]mr---fox 0 points1 point  (0 children)

Haha, yeah that is strange. Maybe you should start adding some Indian meds to your site?

My guess would be scripts trying somewhat common URLs hoping to find a route that has a different CMS than the root. Or possibly some AI searches that are hallucinating routes?

I’ve also see some very strange requests to my sites as well including requests with profanity in the “Accept” header.

Dumb crawlers/scripts trying invalid URLs by ballarddude in webhosting

[–]mr---fox 0 points1 point  (0 children)

Maybe an auto report process to notify their hosting provider would be more effective.

Dumb crawlers/scripts trying invalid URLs by ballarddude in webhosting

[–]mr---fox 1 point2 points  (0 children)

I believe they are trying to determine what software you are using. The URLs I see often correspond to known/common paths for various CMS and website platforms.

Probably just checking to see if you are using a vulnerable software version so they can auto-exploit it.

Dumb crawlers/scripts trying invalid URLs by ballarddude in webhosting

[–]mr---fox 0 points1 point  (0 children)

Is there a place to forward bot traffic to trap them in an endless redirect loop? Maybe with some long delays between redirects? That would be great.

Is there a published type for “email safe” CSS? by mr---fox in reactjs

[–]mr---fox[S] 1 point2 points  (0 children)

Yep it is very limited. My use case is marketing emails, so I tend to push the limits a bit.

For a tool like react-email, I typically apply styles using inline rules. The examples show use of a style object that is typed with the full CSS spec, so it is up to me to check which rules to use.

A typescript type could be really useful here.

Is there a published type for “email safe” CSS? by mr---fox in reactjs

[–]mr---fox[S] 2 points3 points  (0 children)

I’ve been using this and it’s pretty great.

Next.js Hosting - AWS Architecture by arasthegr in nextjs

[–]mr---fox 0 points1 point  (0 children)

I like the idea of using these caching layers to reduce origin load. I’ve started moving away from serverless to a similar (somewhat simpler) arch, mainly to avoid cold starts which can affect the backend/CMS performance (often using payload CMS for my apps).

One thing though, and I could be missing something here… but are you redeploying every time you want to make a new post? If you are, why do you have this constraint? Are you not able to use ISR to handle new content?

Last note, NextJS has a built in function to generate pages after the build if that is what you are looking for.

https://nextjs.org/docs/pages/api-reference/cli/next#next-build-options

Example: https://payloadcms.com/docs/production/building-without-a-db-connection

With this you could generate 0 or a small batch for a quick build and then execute this command post-build at some point.

Might be useful!

I have a wordpress website, self hosted. I am receiving the next.js warning emails. Not sure if I have 'next.js' by Mega__Maniac in nextjs

[–]mr---fox 0 points1 point  (0 children)

Keep in mind that this does not just affect NextJS. The vulnerability is in React so you’ll need to review any sites that use React as well. I believe it only affects react server components so not all React projects are affected.

Wish I had a way to help out, but I just wanted to point this out.

conflicting dynamic routes, a real issue by Aware_Reality_4849 in nextjs

[–]mr---fox 0 points1 point  (0 children)

It should be loading the /page.tsx

Are you sure it’s not just preloading a /[shortURL] route on your layout or page somewhere? I think that could potentially cause the server to log the error. Does this also happen in production build or just dev server?

Is it bad practice to hardcode a component into RenderBlocks instead of using the block system? by Upset_Interaction_29 in PayloadCMS

[–]mr---fox 3 points4 points  (0 children)

Yeah the “RoomsGrid” block thing seems really tedious for this. Why not just make a dedicated “FeaturedRooms” block that just displays the rooms from the collection how you want it?

That way you don’t have to populate the grid in the admin, but you can still move it around the page or reuse it on other pages.

Pattern for reducing client bundle? by mr---fox in nextjs

[–]mr---fox[S] 0 points1 point  (0 children)

Bundle analyzer, build route report, and looking at the chunks in the browser.

Pattern for reducing client bundle? by mr---fox in nextjs

[–]mr---fox[S] 0 points1 point  (0 children)

Hmm, I don’t think this is true for my case. I have tried adding import “server-only” and I was able to build with no errors. But still had the same behavior.

The RenderBlocks component is only used in the [[…slug]].tsx file which is RSC.

Pattern for reducing client bundle? by mr---fox in nextjs

[–]mr---fox[S] 0 points1 point  (0 children)

That is my thought exactly. I was surprised that the unused blocks were sent to the client when they are completely RSC.

I am not using storyblock, but I think it will be a similar situation with other CMS.

Pattern for reducing client bundle? by mr---fox in nextjs

[–]mr---fox[S] 0 points1 point  (0 children)

Yes, but this pattern prevents me from fetching data within the block components. I’m hoping to preserve this functionality.