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

avoid expensive queries that do not change certain results #53

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

elcapo
Copy link
Contributor

@elcapo elcapo commented Oct 21, 2024

The mayIndex function, which checks whether a page can be indexed or not, is downloading the website content even if the robots.txt was already cached and disallowing that page.

With this PR no result is changed but in case the robots.txt denies a page, it won't even be fetched (as reading the page meta wouldn't change that result).

The results of the tests is exactly the same after this change, only that some unnecessary calls to (the expensive) file_get_contents are avoided.

@riasvdv riasvdv merged commit 31763e5 into spatie:main Oct 22, 2024
7 checks passed
@riasvdv
Copy link
Member

riasvdv commented Oct 22, 2024

Thanks!

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