SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 1 C++

Enhance image freshness check before stored into cache (#23226)

Summary:
This is a re-submit of D13895627 which got landed but didn't include a fix to Instagram's code. The sheriffs were unsure how it got landed without running the build.

Currently, before we store the image to cache, we only respect `Cache-Control`, actually, we also may need to check `Expires`、`Last-Modified`, refer to [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness), and  [okhttp](https://github.com/square/okhttp/blob/568a91c44a118b2c2ba62d310a331582c567b24a/okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java#L268) respect the `MDN`, so in iOS, we can also respect this.

[iOS] [Fixed] - Respect `MDN` cache strategy before cache the image.

Reviewed By: shergin

Differential Revision: D13896822

Pulled By: cpojer

fbshipit-source-id: 8c1714f4a17ad40496146806cff3e188a60be93c
Z
zhongwuzw committed
fb8ba3fe959fd2a0c4ef0025fd84f6deffd9d03b
Parent: a4840e7
Committed by Facebook Github Bot <facebook-github-bot@users.noreply.github.com> on 2/6/2019, 10:07:17 AM