TiO2 compact layers produced by spin coating of different precursors are compared. TiCl4-compact layer is used in mesoscopic architectures for the first time. Larger crystals in TiCl4-compact layer compared to Ti-isopropoxide-compact layers. TiCl4-based cells exhibit the longest lifetime and negligible hysteresis.