[go: up one dir, main page]

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

ISG for a lot of content #598

Open
Borea opened this issue Mar 14, 2024 · 4 comments
Open

ISG for a lot of content #598

Borea opened this issue Mar 14, 2024 · 4 comments

Comments

@Borea
Copy link
Borea commented Mar 14, 2024

Hello, I have a website with a 15k posts, and I want to use ISG but query inly return 100 posts maximum. I tried this solution https://stackoverflow.com/questions/70175630/wp-graphql-query-only-returns-first-100-posts-when-generating-sitemap but my website collapse... I spen a day trying to find a solution to prerender 15k posts, or 1k and the next rendering in the server.

Can you please help me or some idea why can I do in this case. Ty

@colbyfayock
Copy link
Owner

hey @Borea thats a great question and i dont think i have a good answer, so maybe someone else can chime in

that said, is it critical to prerender that many posts to start? i think generally speaking, thats a pretty huge query, and it would be a slow one

something you may also want to consider is caching your wordpress queries which may help in certain situations:

tutorial: https://www.youtube.com/watch?v=9QIMXxDSAyQ

@Borea
Copy link
Author
Borea commented Mar 16, 2024

Hello, thanks for you repply @colbyfayock and sorry for my bad english.

I will check the video, thanks. But in cases like wp-search.json archive? I need to fetch all items to stored in json search or can be uptated if i request a content who is not initial builded? Same question for pagination, for example I have a pagination with 10 pages because I only can fetch 100 items (10 per page) if I request 10 items who are not pre builded, when build, thats items will appear in a new page in pagination?

Im a lot of questions, I will check you channel, thanks again.

@Fran-A-Dev
Copy link

Hi @Borea ,
I'm Fran, from DevRel at WP Engine and I focus on headless WordPress. I was asking around in our headless WP Discord server and what I got are these options you could do.

Instead of rebuilding the entire search index with each change you could implement and modify something like a hook into WP post's save and delete actions which would require some back-end code in WP to trigger these updates to your static JSON file.

And for the initial build of the search index or complete rebuilds, use the batch processing approach to fetch all content. The server load is what I'm concerned about here.

The pagination updates would be handled dynamically client side on items that are not prebuilt. You can use ISR here. You could also fallback and load for items not prebuilt and fetched client side and displayed dynamically.

This will be a huge JSON file. The other route you could do is an advanced search or just the WP search. Hopefully this helps a little.

@Borea
Copy link
Author
Borea commented Mar 27, 2024

Hi @Borea , I'm Fran, from DevRel at WP Engine and I focus on headless WordPress. I was asking around in our headless WP Discord server and what I got are these options you could do.

Instead of rebuilding the entire search index with each change you could implement and modify something like a hook into WP post's save and delete actions which would require some back-end code in WP to trigger these updates to your static JSON file.

And for the initial build of the search index or complete rebuilds, use the batch processing approach to fetch all content. The server load is what I'm concerned about here.

The pagination updates would be handled dynamically client side on items that are not prebuilt. You can use ISR here. You could also fallback and load for items not prebuilt and fetched client side and displayed dynamically.

This will be a huge JSON file. The other route you could do is an advanced search or just the WP search. Hopefully this helps a little.

Thanks for ideas. I have resumed the project this day again and I will try this thread suggestions.

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

3 participants