senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. tateisu​ :force:​:r_9a: (tateisu@mastodon.juggler.jp)'s status on Wednesday, 16-Jan-2019 00:57:44 JST tateisu​ :force:​:r_9a: tateisu​ :force:​:r_9a:

    okhttpのCacheControl.Builder.maxStale()の挙動を誤解してた。リクエストにCacheControl.Builder.maxStaleを指定するとageがstale期限内であればネットワークアクセスは行われないのだった。

    In conversation Wednesday, 16-Jan-2019 00:57:44 JST from mastodon.juggler.jp permalink
    • tateisu​ :force:​:r_9a: (tateisu@mastodon.juggler.jp)'s status on Wednesday, 16-Jan-2019 01:00:32 JST tateisu​ :force:​:r_9a: tateisu​ :force:​:r_9a:
      in reply to

      okhttpのリポジトリをgit cloneしてandroid studioで超適当に開く。
      CacheControl.Builder.maxStale()経由でセットされるCacheControl.maxStaleSeconds() をFind Usages
      CacheStrategy.Factory.getCandidate()で使われてる。
      - mustRevalidate() が偽
      - noCache()が偽
      - maxStaleSeconds()が-1ではない
      - ageMillis + minFreshMillis < freshMillis + maxStaleMillis
      上記条件をすべて満たすとネットワークアクセスなしでキャッシュレスポンスを返す。
      さらにFind Usagesを辿ると CacheInterceptor.intercept() が CacheStrategy.Factory.get() を呼び出す。
      RealCall.getResponseWithInterceptorChain() が CacheInterceptor を生成する。

      In conversation Wednesday, 16-Jan-2019 01:00:32 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.