i am using yii2 listView widget to list some items, i have noticed that in the header there is rel="prefetch"
and rel="next"
, don't know why.
what is the point of having such these links in the header? how could i disable this ?
i am using yii2 listView widget to list some items, i have noticed that in the header there is rel="prefetch"
and rel="next"
, don't know why.
what is the point of having such these links in the header? how could i disable this ?
Prefetched data is fetched and processed on initialization. If the browser supports local storage, the processed data will be cached there to prevent additional network requests on subsequent page loads.
it is not enabled by default, enabling prefetch can be accomplished by just adding rel="prefetch"
to a specific url.
WARNING: While it's possible to get away with it for smaller data sets, prefetched data isn't meant to contain entire sets of data. Rather, it should act as a first-level cache. Ignoring this warning means you'll run the risk of hitting [local storage limits].
When configuring prefetch
, the following options are available.
url
– The URL prefetch data should be loaded from. Required.
cache
– If false
, will not attempt to read or write to local storage and
will always load prefetch data from url
on initialization. Defaults to
true
.
ttl
– The time (in milliseconds) the prefetched data should be cached in
local storage. Defaults to 86400000
(1 day).
cacheKey
– The key that data will be stored in local storage under.
Defaults to value of url
.
thumbprint
– A string used for thumbprinting prefetched data. If this
doesn't match what's stored in local storage, the data will be refetched.
prepare
– A function that provides a hook to allow you to prepare the
settings object passed to transport
when a request is about to be made.
The function signature should be prepare(settings)
where settings
is the
default settings object created internally by the Bloodhound instance. The
prepare
function should return a settings object. Defaults to the
[identity function].
transform
– A function with the signature transform(response)
that allows
you to transform the prefetch response before the Bloodhound instance operates
on it. Defaults to the [identity function].