XenForo admin area isn’t inside a directory but is accessible via the admin.php file. So one can’t add htaccess based password protection to a directory
Cache is a mechanism to create multiple copies of the original data and store it in a form such that it can be accessed much faster.
An unexpected shut down of MySQL due to memory and xf_session table being frequently written is likely to crash and is the root cause of the issue.
In XenForo, templates can contain HTML or CSS code along with a wide range of template Syntax like if conditions, foreach syntax, contentcheck etc.