'Is there a method to clear Expo cache?

I'm working on a task where I have to update a product images. Expo cache is posing a problem, when I update the product images and re-render the screen it does update my store state but doesn't show it. When I manually cleared expo cache it did work.

I have also tried using the 'Cache-Control' header, but that didn't solve the problem.

Is there a method I can call to clear expo cache ?



Solution 1:[1]

If you want to delete the cache you can use FileSystem from Expo. In that example you can delete the directory in the cache using FileSystem.deleteAsync

// Deletes whole giphy directory with all its content
export async function deleteAllGifs() {
  console.log('Deleting all GIF files...');
  await FileSystem.deleteAsync(gifDir);
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Brandonjgs