Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics.transactionMetrics.last?.resourceFetchType returns network instead of cache, but the first transactionMetrics have localCache #24

Open
loryhuz opened this issue Dec 16, 2023 · 2 comments

Comments

@loryhuz
Copy link

loryhuz commented Dec 16, 2023

Hi,

The CachedImageSync is playing animation even if the image comes from cache.
After debugging I have metrics.transactionMetrics.count equal 2 and it returns resourceFetchType = .localCache in the first object, not the last one.

Do you have this as well or it's just me?

Thanks!

@loryhuz
Copy link
Author

loryhuz commented Dec 16, 2023

After some investigations it comes from the default cache policies (which will return 2 transactions in some case, the first one is the cached one according to apple).

I opened a PR for this issue:
#25

@dehlen
Copy link

dehlen commented Jul 8, 2024

I am not 100% sure but I think this is not the right fix. The reason why there are two values is that first the image was loaded from cache but was stale (expired) which is why the new data was fetched from the network resulting in two transaction values. In this case the animation should run, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants