Cypress's cy.get seems to reload my static assets like images aggressively without caching them

Viewed 515

When running my tests with the network tab open, I see the request count running very high. It seems like every cy.get() loads all static assets on that page as if it were a full page reload.

The initiator of these requests is the Cypress runner. Is this the way cypress works? Is there a way to cache these images? Normal browser caching does not seem to work.

The high request count causes the browser to use more and more memory, resulting in slower and slower tests over time.

I've added a screenshot below to show that the same images are being loaded without caching within a very short timespan. This applies to other static assets like fonts too.

An image showing aggressive requests for .svg images

1 Answers

Apparently this issue was reported by someone else 4 days ago. This is a cypress issue caused by createSnapshot

Here's a link to the original Github issue

Related