I'm developing theme and I want to make page cache of static pages in my WordPress theme (and basically I know how to implement it)
The problem is that when making theme - the first time when I "get any control" about what is happening is inside functions.php file of theme, and this file is loaded about 1 sec after request starts (before it is loading all wordpress functions stuff, I quess some sql - but I dont need that all as I'm using page cache, just want to render saved html - thats what is cache about to dont init functionality of page).
So the question is - Am I able to - from level of theme - take control of WordPress initialization before theme functions.php? - the best would be as soon as possible after request start
Why? Getting html from cache takes 0,05s in my case, and time from request start to functions.php is 1s so in sume it gives 1,05s that I could reduce to like 0,1s if I'm able to 'capture' request earlier.
I dont want to modify non-theme files like WordPress core files as many people will use this theme, but if there is no other way than maybe but I dont feel it would be good practice?