solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
5.17k stars 375 forks source link

Feature Request - Incremental Static Regeneration (ISR) #443

Closed jdgamble555 closed 10 months ago

jdgamble555 commented 1 year ago

There doesn't seem to be an official feature request for this, and the talk is short on discord. I also believe there is confusion on what this is.

There needs to be a way to automatically handle the cache-control header in routes so that refreshing at different intervals, or caching an entire route is possible until some sort of invalidation.

https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration https://www.vuemastery.com/blog/new-nuxt-3-feature-incremental-static-generation/

It may would need to be handled inside solid-start, then have the adapters handle the specific serverless environments. This is huge for many potential adopters, as having an easy way to cache their api endpoints is crucial for saving money on database reads, and faster page loads. Having the ability to call a trigger to revalidate a route would really help, for example when the database gets updated. A new deployment would regenerate all routes.

Cache-control

Remix does not have ISR, and claims that it is vendor-lock-in for Next and Vercel, which is simply not true. All hosting providers for NextJS offer the framework way of doing this. This is also true for NuxtJS, and will soon be true with the adapters for SvelteKit.

Please add this feature, as I believe it will be the reason a lot of people switch from Next to Solid Start.

J

jpmaga commented 1 year ago

Hello, I got a version of this working today. Over the course of the week I plan to make a pull request to the vercel adapter. Just need to test it a bit more, and play with which settings are needed, like the bypassValue, expiration, etc...

jpmaga commented 1 year ago

Turns out I had bit more time today than expected. https://github.com/solidjs/solid-start/pull/466

jdgamble555 commented 1 year ago

Oh nice! Is this all routes, or does it let you customize the cache based on the router?

Also, it seems for this moment in time, Vercel is the only serverless platform that has on-demand revalidation, but we hope that changes soon.

Thanks,

J

jpmaga commented 1 year ago

Oh nice! Is this all routes, or does it let you customize the cache based on the router?

Also, it seems for this moment in time, Vercel is the only serverless platform that has on-demand revalidation, but we hope that changes soon.

Thanks,

J

I am not sure. I think the prerender functions take precedence over http headers. If that is the case, then it won't be possible to fine tune the routes without some considerable code changes on the adapter.

Yeah, on-demand revalidation is the killer deal here, at least for me and my company.

subhasishdas159 commented 1 year ago

Yes need this feature badly. Next js already has this feature. Need it in solid start as well.

ryansolid commented 10 months ago

In setting up for SolidStarts next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed in mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.

See https://github.com/solidjs/solid-start/pull/1139 for more details.