dylanPowers / ipfs-chrome-extension

Access gateway.ipfs.io urls the way they were meant: from your locally running ipfs daemon
BSD 3-Clause "New" or "Revised" License
68 stars 9 forks source link

Fallback to gateway.ipfs.io #2

Closed dylanPowers closed 9 years ago

dylanPowers commented 9 years ago

When the local or custom gateway fails for any reason, fall back to gateway.ipfs.io. Implementation details:

jbenet commented 9 years ago
  • Recheck every 5 minutes?

FWIW, checking it the service is available locally on every page load is super cheap, because it's local (0 latency). Can start there and do something more complicated later.

  • Use /version api to check if up

yep, this is a good use case for /version

  • Have a command in the options menu to manually check and show the status

+1

dylanPowers commented 9 years ago

The resulting solution is to wait until a request failure occurs, flag that the local gateway is in a failure state, and then wait 30 seconds before attempting to send requests to the local gateway again. That ended up being the most reasonable solution.

I've closed this in commit 53274525212356e578b8e6fea4198f4b50816cac