Allow for the browser caching of files during tests
See original GitHub issueWhat would you like?
The ability to browser cache files in Cypress tests.
Why is this needed?
In applications that leverage the microfrontend architecture, each microfrontend has a single entry point (*.js file). In many cases, this single *.js file includes everything in that module and it can be somewhat large. Code splitting is possible, but it does not fully mitigate the problem described below.
An application that uses the microfrontend architecture relies heavily on browser caching. Each *.js file is versioned with a unique URL and has a cache-control
header with a large max-age
ie. it’s browser cached for a long time. This means that the initial load time of a new version of a microfrontend is long, but subsequent loads in a browser are fast.
Since browser caching files is not possible in Cypress tests, every Cypress test (it
block) for a microfrontend has a long initial load time because it’s downloading the *.js file in full and not retrieving it from browser cache. Having Cypress tests always taking a long time to execute is quite suboptimal.
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7
Top GitHub Comments
Came across this issue as well. My js bundles are identical and loading them is 80% of the test duration.
@pmk1c Thanks for sharing. I had not come across Vite before. In the microfrontend ecosystem, each microfrontend does not have an *.html file (there is only one *.html file in the entire ecosystem). From what I was able to quickly read in their documentation, Vite is entirely based on the entry point being one or more *.html files so Vite will not work for single-spa-based microfrontends.