Fetch public templates as files

lamvunhat

Member
"Fetch public templates as files" is good way to make better performance. I am using 6 web servers (load balancing). But i don't know about how to make "Fetch public templates as files". Can you help me?
 
Templates as files will only be a performance benefit if you have an opcode cache installed in PHP such as APC. The templates will be stored in internal_data/templates if you enable that option.
 
Templates as files will only be a performance benefit if you have an opcode cache installed in PHP such as APC. The templates will be stored in internal_data/templates if you enable that option.

Yes, I have an opcode cache installed (eAccelerator). But the problem is: If I edit the template, how do all the server can rebuid the template compiled (stored in internal_data/templates)
 
Oh. With multiple front end servers that will be a problem. You would have to setup file replication between the servers.

If you use a web server cluster for your web site you have to do that anyway. There are several directories (avatars, attachments, etc) that need to be synchronized...

So, either you don't have 6 web servers currently serving your single XenForo site or there is another problem with your question...
 
If you use a web server cluster for your web site you have to do that anyway. There are several directories (avatars, attachments, etc) that need to be synchronized...

So, either you don't have 6 web servers currently serving your single XenForo site or there is another problem with your question...
Not really. If your site requires 6 web servers you're probably using a CDN. You can serve avatars and attachments from a CDN (with origin pull). Even for full attachments, at least with an addon. That's not an option for templates because they're not static.

In which case, Jake's answer is correct and your post contributes nothing to the conversation other than the usual skepticism.
 
If you use a web server cluster for your web site you have to do that anyway. There are several directories (avatars, attachments, etc) that need to be synchronized...

So, either you don't have 6 web servers currently serving your single XenForo site or there is another problem with your question...
Not really. If your site requires 6 web servers you're probably using a CDN. You can serve avatars and attachments from a CDN (with origin pull). Even for full attachments, at least with an addon. That's not an option for templates because they're not static.

In which case, Jake's answer is correct and your post contributes nothing to the conversation other than the usual skepticism.

http://muare.vn
Disable attachment by Xenforo and develop add-on as Image manager. I have a server images storage (Avatar, Image upload by member) via cURL. Only file image is allowed to upload on my system. But "Fetch public templates as files" is other issues :oops:
 
Templates as files will only be a performance benefit if you have an opcode cache installed in PHP such as APC. The templates will be stored in internal_data/templates if you enable that option.

Does one have to add anything to "config.php" after enabling "Fetch public templates as files"?

Can the folder "templates" and its contents be safely deleted after disabling "Fetch public templates as files"?
 
No, just the fact that they are on the file system as PHP files is enough for your opcode cache (if you have one) to handle them.

Incidentally, in XF2, there is no option and the templates are just stored there by default.

Yes, you can delete the internal_data/templates directory in XF1 if you are no longer using that option. The files should be deleted automatically, though.
 
Back
Top Bottom