Moving forum files to an external CDN

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sat May 04, 2013 3:33 am

There is a file called "template.php" located inside /includes/.

Find this:

Code: Select all

/**
	* Set custom template location (able to use directory outside of phpBB)
	* @access public
	*/
	function set_custom_template($template_path, $template_name, $fallback_template_path = false)
	{
Has this part something to do with change the template path. Sorry, I dont understand PHP.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Moving forum files to an external CDN

Post by Lumpy Burgertushie » Sat May 04, 2013 3:55 am

where did you get the idea that you need to or even could, do this?

if your board is new then there is no way that it can be overloading any decent server even a free one.


there are many people that run very busy phpbb boards on free hosts without this problem.

In all the years I have been here, this is the first time I have seen this particular problem mentioned.

there are plenty of other types of problems when using free hosting but not this one.

there are certain requirements to be able to install and run phpbb, apparently this host does not meet those requirements.

so, you need to find a host that does.
http://www.freewebhostingtalk.com/
what you are trying to do simply will not work with phpbb.
no offense but I dont think you understand how this all works. I am not sure you understand how this CDN stuff works either.

luck,
robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: Moving forum files to an external CDN

Post by Oleg » Sat May 04, 2013 4:16 am

Oyabun1 wrote:From what I've seen it cannot be easily done with the current phpBB line because phpBB uses relative URLs not absolute and they would need to be changed for every asset moved. There will be changes in phpBB 3.1 to make it much easier.
I believe this is possible, see viewtopic.php?f=46&t=2148721#p13102378.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com

User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sat May 04, 2013 4:52 am

Lumpy Burgertushie wrote:where did you get the idea that you need to or even could, do this?

if your board is new then there is no way that it can be overloading any decent server even a free one.


there are many people that run very busy phpbb boards on free hosts without this problem.

In all the years I have been here, this is the first time I have seen this particular problem mentioned.

there are plenty of other types of problems when using free hosting but not this one.

there are certain requirements to be able to install and run phpbb, apparently this host does not meet those requirements.

so, you need to find a host that does.
http://www.freewebhostingtalk.com/
what you are trying to do simply will not work with phpbb.
no offense but I dont think you understand how this all works. I am not sure you understand how this CDN stuff works either.

luck,
robert
Hi Robert, thanks for keeping up with me.

What I am trying to do is to make phpbb load ALL *static* resources (I understand that php stuff can't be loaded off a CDN, though some so allow, but most don't) off a CDN so that the number of files accessed on my free web host server is reduced, thus keeping within the limit. I want to do this because I want more and more users to be able to be online simultaneously without my site going offline.

I have just understood how things are working. Going to the index page means the index.php file is accessed first, it calls other php files, which further call more, and such a chain continues.

I wanted to know how and which php files call the style files (templates). I have just come to know it. At the end of most php files at phpbb's root, there's a section called "// output blah blah blah" (commented) which actually triggers calls to template files which further call other assets like CSS, JS and images.

All the paths are relative as I have seen. I can simply replace them with absolute direct links from CDN, which I am currently doing. I am only doing this for static resources like HTML, CSS, JS and images. PHP is what I have kept apart.

I will post back after I carry out all these tasks and tell ya if this goes successfully.
Oleg wrote:
Oyabun1 wrote:From what I've seen it cannot be easily done with the current phpBB line because phpBB uses relative URLs not absolute and they would need to be changed for every asset moved. There will be changes in phpBB 3.1 to make it much easier.
I believe this is possible, see viewtopic.php?f=46&t=2148721#p13102378.
I knew it was. Thanks. :)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Moving forum files to an external CDN

Post by Lumpy Burgertushie » Sat May 04, 2013 5:16 am

but even the html is not totally static. it is full of php varibles which have to call the datbase and/or the php files in order to work. each time that html file is called it will require some different data and therefore will not be the same always.

as a mental exercise, I can see a benefit to this, but there is no practical reason to go to all this trouble when a few minutes of searching for a new free host would solve all the problems for you.
is there some reason you are not listening to reason about how unusually restrictive this free host of yours is?

if you expect to get hundreds of users at one time then you should really consider a paid host if you are at all serious about having a bulletin board for whatever your subject is.

luck,
robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sat May 04, 2013 5:32 am

Lumpy Burgertushie wrote:but even the html is not totally static. it is full of php varibles which have to call the datbase and/or the php files in order to work. each time that html file is called it will require some different data and therefore will not be the same always.

as a mental exercise, I can see a benefit to this, but there is no practical reason to go to all this trouble when a few minutes of searching for a new free host would solve all the problems for you.
is there some reason you are not listening to reason about how unusually restrictive this free host of yours is?

if you expect to get hundreds of users at one time then you should really consider a paid host if you are at all serious about having a bulletin board for whatever your subject is.

luck,
robert
OK, let me give it a try, if it works, then good, or I'll leave it! :oops:

Paid hosting is not currently an option for me. I have to use free. And I need atleast 2 GB of mysql space. most hosts give just few MBs, expect Byet Free host, which is really providing not "unlimited" but "unmetered" mysql space, their support says they don't limit mysql space. That's what I want. Who else gives unmetered or large mysql space? I have searched a lot, could not find one, maybe I don't know how search.

If you know such a free service which fulfills these, it would be great if you share which one it is. :)

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Moving forum files to an external CDN

Post by Mick » Sat May 04, 2013 8:08 am

We highly recommend that you do not use a free host. Everyone of them has certain issues and limitations. However if you must use a free host FreeHostingTalk can assist you in locating a host.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sat May 04, 2013 8:41 am

Ahh! Everything was going as expected but I have a little problem.

<!-- INCLUDE forumlist_body.html -->

The above line. Phpbb automatically prefixes the default template path before forumlist_body.html to make it styles/<stylename>/templates/forumlist_body.html.

So there's that one single problem. If I put a static URL like http://cdn.com/forumlist_body.html, then phpbb makes it styles/<stylename>/templates/http://cdn.com/forumlist_body.html, which is invalid.

So my question is:

How can I change the default template/theme/imageset paths?

this forum has lots of knowledgeable members so I expect atleast one of them must be having an answer to this simple question.

User avatar
5hocK
Registered User
Posts: 3011
Joined: Wed Nov 23, 2011 7:00 pm
Location: England

Re: Moving forum files to an external CDN

Post by 5hocK » Sat May 04, 2013 8:54 am

nilanko wrote:And I need atleast 2 GB of mysql space.
That would be one huge forum and would never be allowed to run on a free host - even if they did allow it your 50 GB a month bandwidth limit would be used in days.
A thread is pretty much a topic. Stop with the pedantics will ya.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Moving forum files to an external CDN

Post by Lumpy Burgertushie » Sat May 04, 2013 12:39 pm

for a board that is just starting, what makes you think you would need all that much space within the first few years? by the way, do you think the space on the servers where this "cdn" will be is going to be free?

from what I understand, ( very limited I know ) this CDN stuff is just basic caching like they sometimes do at the ISP or hosting level. where exactly do you think you can upload these files you are trying to separate from the rest of them?


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sat May 04, 2013 8:32 pm

Lumpy Burgertushie wrote:for a board that is just starting, what makes you think you would need all that much space within the first few years? by the way, do you think the space on the servers where this "cdn" will be is going to be free?

from what I understand, ( very limited I know ) this CDN stuff is just basic caching like they sometimes do at the ISP or hosting level. where exactly do you think you can upload these files you are trying to separate from the rest of them?


robert
Ok lemme tell ya.

I know the board is new. i don't care if anyone is posting there or not, but I myself will keep posting stuff. So the need for space. I don't actaully use a CDN, I use dropbox as a CDN: it gives me free 2GB of space (or upto 16GB) which is enough for storing my few MBs of static stuff. Images on pages (style ones) add a lot of hits, so I wanna move them out.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Moving forum files to an external CDN

Post by Mick » Sat May 04, 2013 9:30 pm

Your request isn't support related and, seeing as what you require would need a MOD, I suggest you make a MOD request.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
DionDesigns
Registered User
Posts: 515
Joined: Sun Feb 26, 2012 11:22 pm
Location: Uncertain due to momentum.
Contact:

Re: Moving forum files to an external CDN

Post by DionDesigns » Sat May 04, 2013 11:22 pm

It makes no sense to change the location of the template files since phpBB compiles them and uses the cached compiled versions. It's possible to change the location of the cache to be offsite, but that requires allow_url_fopen to be set to ON. Check your PHP configuration...if allow_url_fopen is set to OFF, you'll need to find a new free host because you will not be able to move the cache offsite. However, even if you're able to move the cache offsite, doing so will have a potentially-significant negative impact on the performance of your board.

I also question this "file access" limit. Database access is file access -- does database access count against that limit? If it does, you're wasting your time with all this...find a new free host.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Moving forum files to an external CDN

Post by Lumpy Burgertushie » Sun May 05, 2013 12:31 am

see, what you are asking about doesn't even work the way you think it does, much less do you even need to try and figure this out.
GET a NEW HOST that does not have this crazy restriction in place. as I have told you several times, this is not a problem even with free hosts. apparently it is only a problem with the free host you are using. GET A NEW FREE HOST.

did I mention, GET a NEW HOST?


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
nilanko
Registered User
Posts: 133
Joined: Sun Apr 21, 2013 7:32 pm
Location: Earth
Name: Nilanko Halder

Re: Moving forum files to an external CDN

Post by nilanko » Sun May 05, 2013 3:54 am

So ultimately I did it. I have moved out all static stuff: all images, CSS, and JS except html templates and php. Things are working beautifuly. Some generous person have given me a share of their premium web hosting space, so I don't have such limits anymore but still did it so as to reduce load on their server.

Locked

Return to “[3.0.x] Support Forum”