dougehe2022 2017-02-16 17:55
浏览 12

为什么我使用列表视图在标题中获取预取?

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 ?

  • 写回答

1条回答 默认 最新

  • dongqiuwei8667 2017-02-16 18:17
    关注

    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].

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题