CDN support

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Get Involved
Post Reply
User avatar
davidyin
Translator
Posts: 26
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

CDN support

Post by davidyin » Sat Oct 15, 2016 1:36 am

More and more web sites start to use CDN to service static resources, such as images, css, js, smilies.
I am using Amazon CloudFront as CDN for my forum.
I don't know how to write an extension. So I edited some files in include folder to make CDN works.



Is it possible to make an extension to have a switch can enable CDN and a field to enter the CDN URL.

User avatar
kinerity
Registered User
Posts: 1151
Joined: Mon Sep 01, 2014 1:00 am
Name: Kailey Truscott
Contact:

Re: CDN support

Post by kinerity » Sat Oct 15, 2016 7:14 am

There's a setting under ACP -> GENERAL -> Server configuration -> Load settings. Not sure if it checks CloudFront or not when turned on.

Image
phpBB3 Refugees - Unofficial phpBB 3.0.x support

Image

User avatar
david63
Jr. Extension Validator
Posts: 13185
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: CDN support

Post by david63 » Sat Oct 15, 2016 8:34 am

Not sure if this is of any help viewtopic.php?f=456&t=2385266
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
davidyin
Translator
Posts: 26
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin » Sat Oct 15, 2016 4:23 pm

kinerity wrote:There's a setting under ACP -> GENERAL -> Server configuration -> Load settings. Not sure if it checks CloudFront or not when turned on.

Image
Thank you for your suggestion. It doesn't help.
This setting just for jquery and google font. All others are still from origin server.

User avatar
davidyin
Translator
Posts: 26
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin » Sat Oct 15, 2016 4:35 pm

david63 wrote:Not sure if this is of any help viewtopic.php?f=456&t=2385266
This one is to store the uploading files into Amazon S3.

What I need is as below:
The original homepage header.

Code: Select all

<link href="./assets/css/font-awesome.min.css?assets_version=89" rel="stylesheet">
<link href="./styles/prosilver/theme/stylesheet.css?assets_version=89" rel="stylesheet">
<link href="./styles/prosilver/theme/zh_cmn_hans/stylesheet.css?assets_version=89" rel="stylesheet">
<link href="/assets/css/header-nav-32.css" rel="stylesheet">
I want it to be:

Code: Select all

<link href="//mycdn.cloudfront.net/assets/css/font-awesome.min.css?assets_version=89" rel="stylesheet">
<link href="//mycdn.cloudfront.net/styles/prosilver/theme/stylesheet.css?assets_version=89" rel="stylesheet">
<link href="//mycdn.cloudfront.net/styles/prosilver/theme/zh_cmn_hans/stylesheet.css?assets_version=89" rel="stylesheet">
<link href="//mycdn.cloudfront.net/assets/css/header-nav-32.css" rel="stylesheet">
mycdn.cloudfront.net is a CDN hostname for my phpBB installation.

When I do my own modification to implement CDN, I change /forum/includes/functions.php

Code: Select all

// Add CDN path
$cdn_cache = '//mycdn.cloudfront.net/forum/';
//'T_ASSETS_PATH'			=> "{$web_path}assets",
'T_ASSETS_PATH'			=> $cdn_cache."assets",
There are a lot of places need to be changed, including functions_display.php for forum icons and ranks, functions_posting.php for smilies.

User avatar
davidyin
Translator
Posts: 26
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin » Mon Oct 24, 2016 5:21 am

I made my first Extension.
Simple CDN 1.0.0
https://www.phpbbchinese.com/viewtopic.php?f=3&t=144

I submit for validation one week ago. Still pending.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20442
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: CDN support

Post by RMcGirr83 » Mon Oct 24, 2016 9:11 am

It can take up to 30 days, and sometimes longer, for an extension to get validated.

By the way your extension won't pass validation as it doesn't conform to the coding guidelines.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
davidyin
Translator
Posts: 26
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin » Wed Oct 26, 2016 7:06 pm

RMcGirr83 wrote:It can take up to 30 days, and sometimes longer, for an extension to get validated.

By the way your extension won't pass validation as it doesn't conform to the coding guidelines.

Thank you. Could you show me how to validate my extension, or just tell me the error on validation?

I am a newbie in extension development. This is my first trial. Your comments are very important to me.

jmzsoftware
Registered User
Posts: 19
Joined: Mon Oct 31, 2016 8:17 pm

Re: CDN support

Post by jmzsoftware » Mon Oct 31, 2016 8:27 pm

davidyin wrote:
RMcGirr83 wrote:It can take up to 30 days, and sometimes longer, for an extension to get validated.

By the way your extension won't pass validation as it doesn't conform to the coding guidelines.

Thank you. Could you show me how to validate my extension, or just tell me the error on validation?

I am a newbie in extension development. This is my first trial. Your comments are very important to me.
I picked up your extension and tested some things. It doesn't seem to work on anything past the stylesheets. For example, it doesn't work on smilies or avatars. There are a few others too.

JohnBox
Registered User
Posts: 3
Joined: Wed Aug 19, 2015 12:25 pm

Re: CDN support

Post by JohnBox » Mon Nov 20, 2017 6:31 pm

Hi David,
this is a great extension, I have implemented it on my site and it is working after a few tweaks. Not all paths are rewritten but I understand this is due to core file incompatibilities. For me a working robust CDN extension is the single most needed component of phpBB. Are you interested in continuing with it ?

regards, John

Post Reply

Return to “Extension Requests”

Who is online

Users browsing this forum: No registered users and 10 guests

cron