Loading css file across pages takes a fraction of a second

Have you tried playing directly with Streamlit theming?

I don’t know how you wrote in the caching attempt, so if you could share how you structured it as a function that might shed some light. Also, have you tried the new st.experimental_memo? There can be some fiddly bits with caching, but if you cache the actual css to inject as a string to load on the page, I don’t think there should be a problem.