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)
Suggested Hosts
Post Reply
User avatar
davidyin
Translator
Posts: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

CDN support

Post by davidyin »

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
Kailey
Community Team Leader
Community Team Leader
Posts: 3726
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: CDN support

Post by Kailey »

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

Image
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: CDN support

Post by david63 »

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!

I now no longer support any of my extensions but they will start to become available here
User avatar
davidyin
Translator
Posts: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin »

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: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin »

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: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin »

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
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: CDN support

Post by RMcGirr83 »

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.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
davidyin
Translator
Posts: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin »

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 »

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 »

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
User avatar
davidyin
Translator
Posts: 100
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

Re: CDN support

Post by davidyin »

viewtopic.php?f=456&t=2494791

I made it much better now. See new version above.
Post Reply

Return to “Extension Requests”