• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fetch public templates as files

#1
"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?
 

Jake Bunce

XenForo moderator
Staff member
#2
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.
 
#3
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)
 

Jake Bunce

XenForo moderator
Staff member
#4
Oh. With multiple front end servers that will be a problem. You would have to setup file replication between the servers.
 

HWS

Well-known member
#5
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...
 

Jeremy P

Well-known member
#6
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.
 
#7
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:
 

Aivaras

Active member
#8
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"?
 

Chris D

XenForo developer
Staff member
#9
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.