Fixed delete doc for doctype
Optimized sessions.clear_cache