Giter Site home page Giter Site logo

请问楼主,这个缓存的获取策略是什么?如果想要先获取缓存数据显示,接着获取网络数据,等网络数据回来之后覆盖的话要怎么实现呢 about dio-http-cache HOT 3 CLOSED

chenchengyin avatar chenchengyin commented on July 19, 2024
请问楼主,这个缓存的获取策略是什么?如果想要先获取缓存数据显示,接着获取网络数据,等网络数据回来之后覆盖的话要怎么实现呢

from dio-http-cache.

Comments (3)

hurshi avatar hurshi commented on July 19, 2024

https://github.com/hurshi/dio-http-cache/blob/master/README.md

from dio-http-cache.

jinxing88 avatar jinxing88 commented on July 19, 2024

https://github.com/hurshi/dio-http-cache/blob/master/README.md

看了文档,只有两种缓存策略啊,貌似不支持先获取缓存数据,紧接着从网络获取数据覆盖吧

from dio-http-cache.

xujinping avatar xujinping commented on July 19, 2024

的确不支持先读取本地缓存,在获取网络数据覆盖。目前看了只支持
1.没设置强制刷新(默认没设置),从缓存读取未过期的数据,缓存有数据,直接返回,缓存没数据从网络返回数据
2.设置了强制刷新
2.1 先从网络获取数据,
2.2 获取数据成功,写入缓存,返回数据
2.3 获取数据失败,返回缓存数据

from dio-http-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.