wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Optimize the way we fetch links on home page for warmup

Open jeawhanlee opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. The way we fetch links from the home page to warm up can be optimized as of now we match and get all the links on the homepage here before slicing the array here to preserve only the number filtered.

Describe the solution you'd like We should only match the filtered number of links directly without having to go through unused elements in the array. This would help increase the code efficiency during warm up.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

jeawhanlee avatar May 21 '24 14:05 jeawhanlee

If we start with the filter value, and then we pass them into the validation, we might end up with a lower number than the filter value, which is not what we would want.

Am I missing something?

remyperona avatar May 28 '24 12:05 remyperona

@MathieuLamiot Is this something that can increase the code efficiency and it's worth considering?

piotrbak avatar Jul 01 '24 12:07 piotrbak

Yes, there might be some gain to it.

MathieuLamiot avatar Jul 01 '24 12:07 MathieuLamiot