Maybe I am wrong and sorry in advance if I wrongly accuse you, but since you are using Litespeed you seem to have trouble with ESI and CodeIgnitor. I don't understand why? ESI is no PHP extension, so it can be used with whatever PHP based framework, with or without template engine. ESI tags are ignored by browser and is only considered by web server, if it supports ESI. ESI tags can be handled like HTML, but it doesn't matter where you define it. Whenever your ESI definitions have effect to the output define it wherever you want. Sounds easy, doesn't it?