Problem/Motivation

Currently, the module reacts to all hooks (insert, update, delete). For larger sites, the number of requests can lead to the "429: Too many requests" error.

See
https://rankmath.com/kb/how-to-fix-429-error-with-indexnow-api/
https://www.indexnow.org/faq

Proposed resolution

It is desirable in such cases to make the module only react to insert hooks, and omit the update and delete hooks. This patch should make this configurable.

CommentFileSizeAuthor
#2 3426410-configurable-hooks.patch3.67 KBalexrayu

Issue fork index_now-3426410

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexrayu created an issue. See original summary.

alexrayu’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

Please review the attached patch.

macsim’s picture

Status: Needs review » Needs work

Interesting feature. Thanks for your contribution.
However I think we should either set it per entity type or per bundle instead of setting it globally.
That would give a more granular way to choose which content really is important to index

macsim’s picture

Status: Needs work » Needs review

Can you please check that the feature is fine with the patch https://git.drupalcode.org/project/index_now/-/merge_requests/17.diff ?

macsim’s picture

Status: Needs review » Needs work
macsim’s picture

Status: Needs work » Needs review

  • MacSim committed 0a358ede on 3.1.x
    Issue #3426410: Make entity hooks configurable in config
    
macsim’s picture

Status: Needs review » Fixed
axroth’s picture

@MacSim

thanks for the new release!
Can't we have both features?

macsim’s picture

Status: Fixed » Closed (fixed)
macsim’s picture

Status: Closed (fixed) » Fixed

Hmm sorry I didn't reloaded the page and didn't saw your comment @axroth
What do you mean by "both features?" "per entity type" / "per bundle" ?

What I did here based on what was provided by @alexrayu in #2 is a "per entity type hooks config"
I need to upgrade Index Now Commerce to do the same thing.

We could open a new feature request for a "per bundle hooks config" but it would be more complex especially on the test level.

The feature request has only been merged on 3.1.x branch.

axroth’s picture

> What do you mean by "both features?" "per entity type" / "per bundle" ?

My mistake. I could have seen it in the form. Thanks for having this hook-based feature in this release.

macsim’s picture

Status: Fixed » Closed (fixed)