By default, URLImage uses the standard protocol cache policy (URLCache and Cache-Control headers), which requires an internet connection.
To support offline use, you must configure a URLImageService with a fileStore (like URLImageFileStore) and inject it into the environment. When a file store is configured, URLImage follows the URLImageOptions.FetchPolicy instead of the protocol cache policy.
```swift
import URLImage
import URLImageStore
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
FeedListView()
.environment(\.urlImageService, URLImageService(
fileStore: URLImageFileStore(),
inMemoryStore: URLImageInMemoryStore()
))
}
}
}
Note: Ensure you include the URLImageStore library under "Frameworks, Libraries, and Embedded Content" in your target settings.