[wp-trac] [WordPress Trac] #62085: HTML API: Stop counting no-op seek operations against the quota.
WordPress Trac
noreply at wordpress.org
Mon Feb 10 20:55:54 UTC 2025
#62085: HTML API: Stop counting no-op seek operations against the quota.
--------------------------------------+-----------------------------
Reporter: dmsnell | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: HTML API | Version: 6.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Comment (by westonruter):
I think this is still relevant. To avoid reaching the seek quota, I'm
currently having to keep track of whether the cursor is moved:
https://github.com/WordPress/performance/blob/6459571471b26aee4f63f00e2ba9dfe6f5ce2f39/plugins
/optimization-detective/class-od-html-tag-processor.php#L237-L245
https://github.com/WordPress/performance/blob/6459571471b26aee4f63f00e2ba9dfe6f5ce2f39/plugins
/optimization-detective/class-od-html-tag-processor.php#L324
This is so that the code only calls `seek()` if it needs to move:
https://github.com/WordPress/performance/blob/6459571471b26aee4f63f00e2ba9dfe6f5ce2f39/plugins
/optimization-detective/optimization.php#L301-L305
If, however, the cursor was already at the same location as the given
bookmark, then `seek()` should just be a no-op.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62085#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list