Skip to content

Adding caching support to the SP search data source #4394

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

Merged
merged 3 commits into from
Jun 11, 2025

Conversation

erkanch
Copy link
Contributor

@erkanch erkanch commented Jun 6, 2025

I frequently use the results web part to render dynamic content on the landing pages of intranets. For instance, I use the ViewsRecent to sort news or pages to display "trending" content or sort by last modified to display the recent content, etc. None of these queries use a dynamic search query or filter. So, it becomes redundant to invoke postquery every single time. This new cache timeout setting provides a mechanism to cache the search results for up to 240 minutes as long as the query or the filter or any other settings don't change. This would also help during heavy traffic to help minimize the risk of getting throttled.

@erkanch erkanch changed the base branch from main to develop June 6, 2025 00:11
@wobba
Copy link
Collaborator

wobba commented Jun 6, 2025

Thank you @erkanch. Please add a doc update as part of your change so we document the new settings. You should also look at using the "PnP - Search Rollup" version which turns off dynamic data if you don't need it.

@erkanch
Copy link
Contributor Author

erkanch commented Jun 6, 2025

Hi @wobba I've added the details to the documentation. Is the rollup web part in a separate project? I don't see it mentioned in https://microsoft-search.github.io/pnp-modern-search/#whats-included nor do I see a directory under src/webparts/

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
25.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@wobba
Copy link
Collaborator

wobba commented Jun 11, 2025

Hi @wobba I've added the details to the documentation. Is the rollup web part in a separate project? I don't see it mentioned in https://microsoft-search.github.io/pnp-modern-search/#whats-included nor do I see a directory under src/webparts/

It's a different version when you pick web part after install. It's the same, just a different manifest.

image

@wobba wobba merged commit 98a2727 into microsoft-search:develop Jun 11, 2025
1 of 2 checks passed
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.

2 participants