Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SSR + Hydration + cacheing #3

Open
2 of 3 tasks
joepio opened this issue Oct 28, 2024 · 3 comments
Open
2 of 3 tasks

Use SSR + Hydration + cacheing #3

joepio opened this issue Oct 28, 2024 · 3 comments
Assignees

Comments

@joepio
Copy link
Member

joepio commented Oct 28, 2024

  • User can add new page post build-time
  • HTML pages are cached (e.g. max 24 hrs)
  • Changes are visible instantly relatively quickly after refresh

https://docs.astro.build/en/guides/integrations-guide/netlify/

@Polleps
Copy link
Collaborator

Polleps commented Oct 29, 2024

Pages are built on build time

That is not how SSR works. SSR means pages are build on request time (or served from a cache).

User can add new page post build-time

This is always the case with SSR because the pages don't get build at build time.

Changes are visible instantly

Not possible with Astro + Caching. Astro components are server side only and do not hydrate on the client. Unless we use client components (That means using Svelte or React components in Astro) but those can't handle async functions and will render empty components on the server and then hydrate on the client with the actual data.

Polleps added a commit that referenced this issue Nov 11, 2024
@joepio
Copy link
Member Author

joepio commented Nov 25, 2024

Some solutions:

Manual rebuild button

  • Pressing the button calls a webhook on netlify to rebuild
  • Everything works with SSG. Fewest function invocations.
  • No live-updates, so less optimal UX

Hydration

  • Can Astro components run on the client? Otherwise, we'd need Svelte or React components. Which is a bit of a hassle. UPDATE: no, will need Svelte / React.

@joepio
Copy link
Member Author

joepio commented Dec 16, 2024

Current solution

  • SSR everything
  • Caching works... in some limited way

Invalidate cache on Netlify on command?

  • Instead of rebuilding... Can this be done?

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

No branches or pull requests

2 participants