wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 558 forks source link

Setting cache:false does not take effect in ios #689

Open chenx0000 opened 2 years ago

chenx0000 commented 2 years ago

What react-native version are you using? 0.61.5 What react-native-pdf version are you using? 6.0.0 What platform does your issue occur on? (android/ios/both) ios Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue 2) Interesting logs Setting cache:false does not take effect in ios,but it works in Android.We use absolute path as uri.When the pdf content changes,use the same path to open the content unchanged. Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

uygurugurlu-jf commented 2 years ago

Same issue here

gfgabrielfranca commented 7 months ago

One workaround is to set the Cache-Control header to no-cache like this:

<Pdf
  source={{ 
    headers: { 'Cache-Control': 'no-cache' },
    cache: false,
    uri 
  }}
  ...
/>
oussamakh96 commented 3 months ago

const updatedUrl = ${url}?t=${new Date().getTime()}; Append a timestamp to the URL to force reload and bypass cache