Save the content of a custom CSS file to a local CSS file to make it static
Posted by:
SparkedInnovations
May 14, 2019 at 18:11 (6 year ago)
We have a custom CSS file that is being regenerated each time a page is viewed. This can be seen in the top of the "waterfall" section within GTMetrix reports http://flywheel.link/088039b74384. This CSS file is loading the same content every time, but the server regenerates it since it's not a static file being linked to. We need a way to save the content of it to a local "custom.css" file and then link to that style within the theme to prevent the need for the server to regenerate that file every time it's loaded. We have some custom CSS we wrote to alter the theme to fit our design and want to make sure that doesn't get lost with a theme update. Would it be as simple as throwing it in my child theme folder?