Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CSS compression Improvement suggestion #117
Hi there bud. Finishing theme and found your post on how to decrease the cache size since I noticed that with autoptimize every page creates its own unique compiled CSS file.
Not sure how you are making file names but for my theme I figured out an awesome improvement since I did same thing you did.
I have 7 default theme files which are combined in to one, on compile, http://prntscr.com/h9jw1u
and save it in DB under the cached files option per page
Now on page load this is what goes on
1.a. get the pageid option , check the cache file name , if file is there serve it
1b. Read the inline CSS
this way on pages that have same inline CSS I dont have to compress again
On my demo I have WC, portfolio , events , blog , bbpress etc , so if I dont monkey around and make custom option per each page and category I can get away with 3 4 files that are reused. http://prntscr.com/h9k3bf