You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure it is a bug but i found the api to be misleading:
I expect the ignore configuration to filter the links to observe and so to limit to the survivors the "in viewport" mechanism.
It seems to be not exactly the case: any links sharing the same url that a link that was not ignore by the configuration will be observed.
For example, I used the ignore function receiving an element (uri, elem) => {...} to apply prefetching mechanism only on link having a specific attribute.
So it allows me to decide which link should be prefetching by adding a dedicated attribute.
On my page I have 2 links redirecting to the very same url.
The first one is in my header (not visible by default) and the second one is in my footer.
I decided to put my prefetching attribute only on the link in the footer.
But reloading the page, the prefetching is always done even if my footer link is not in the viewport because the link in the header (having not the dedicated attribute and so that should have be ignored) has the same url...
I could force my intended behavior by specifying a region to observe (the footer) but it adds some complexity and code more difficult to maintain.
So I expect a link that doesn't survive the ignore test to not be observed
The text was updated successfully, but these errors were encountered:
In order to ignore a url for any link in the page, you can either:
Pass the url directly as an ignore option to quicklink.listen().
Identify all the links redirecting to that url in some way: using an attribute, for example, and passing it as ignore option, as explained here.
In this example shared at the beginning of this issue: there were two links redirecting to the same url, but only one of them was marked with the attribute that was passed as an option to ignore. In this case, it would have been preferable to add the attribute to both elements, or pass the url of the link to ignore directly to affect all elements of the page.
Assuming that all links that have redirect to the same url have to be ignored if the developer is actually telling quicklink to explicitly ignore elements with a given attribute, might not be a good way to represent the original intention of the developer in all cases.
Not sure it is a bug but i found the api to be misleading:
I expect the ignore configuration to filter the links to observe and so to limit to the survivors the "in viewport" mechanism.
It seems to be not exactly the case: any links sharing the same url that a link that was not ignore by the configuration will be observed.
For example, I used the ignore function receiving an element (uri, elem) => {...} to apply prefetching mechanism only on link having a specific attribute.
So it allows me to decide which link should be prefetching by adding a dedicated attribute.
On my page I have 2 links redirecting to the very same url.
The first one is in my header (not visible by default) and the second one is in my footer.
I decided to put my prefetching attribute only on the link in the footer.
But reloading the page, the prefetching is always done even if my footer link is not in the viewport because the link in the header (having not the dedicated attribute and so that should have be ignored) has the same url...
I could force my intended behavior by specifying a region to observe (the footer) but it adds some complexity and code more difficult to maintain.
So I expect a link that doesn't survive the ignore test to not be observed
The text was updated successfully, but these errors were encountered: