[RC] Simple CDN Extension 1.0.5[updated]

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
User avatar
davidyin
Translator
Posts: 77
Joined: Sun Jul 31, 2005 9:02 pm
Name: David Yin
Contact:

[RC] Simple CDN Extension 1.0.5[updated]

Post by davidyin »

Extension Name: Simple CDN Extension
Author: David Yin

Extension Description: Serve the static files through CDN, including CSS JS, Avatar, etc.
Extension Version: 1.0.5

Screenshots: Screenshots for the extension
Image

Demo URL: URL to the DEMO for the extension
https://webexample.win/forum/index.php

Extension Download: Enter the URL of the extension to download
https://www.phpbbchinese.com/viewtopic.php?f=19&t=816
Last edited by davidyin on Sat Dec 15, 2018 12:04 am, edited 5 times in total.

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

Re: [RC] Simple CDN Extension 1.0.2

Post by davidyin »

It is my first extension. Any comments are welcome.

If there is any error or bugs, please let me know.

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

Re: [RC] Simple CDN Extension 1.0.2

Post by RMcGirr83 »

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

Re: [RC] Simple CDN Extension 1.0.2

Post by davidyin »


User avatar
John connor
Registered User
Posts: 2414
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [RC] Simple CDN Extension 1.0.2

Post by John connor »

Looks interesting. Right now I use an extension called Amazon AWS S3 to off load attachments to S3.

How does this specifically work? While I have a S3 account, I'm not that familiar with cloudfront. How much is that specific account?

Does your extension work with PHP 7.2?

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

Re: [RC] Simple CDN Extension 1.0.2

Post by davidyin »

@John
It is OK on php 7.2.

CloudFront is a CDN service provided by Amazon.
It can use S3 as origin of the CDN, or use your own web site as a Custom Origin for the CDN.

I prefer to use custom origin. All the files on your won website. Cloudfront will pull the files if requested.

@RMcGirr83

I review the code of this extension.
New version here. [RC]Simple CDN Extension 1.0.4
https://www.phpbbchinese.com/viewtopic.php?f=19&t=816

User avatar
John connor
Registered User
Posts: 2414
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [RC] Simple CDN Extension 1.0.4[updated]

Post by John connor »

So I have an S3 bucket that goes like https://upload-1234.s3.amazonaws.com

Is that the URL I put in your extension? I don't think that will work without credentials.

Can you provide some instructions?

I'm thinking I need a cloudfront account to do this. You can actually upload to the cloudfront account URL without credentials or an API?

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

Re: [RC] Simple CDN Extension 1.0.4[updated]

Post by davidyin »

@John

Yes, no credentials required.

Use custom origin on CloudFront. I am not using S3 bucket for storage. All files stay on your own phpBB server.

Here is some screenshot of my CloudFront settings.

https://www.phpbbchinese.com/viewtopic.php?f=19&t=816

User avatar
John connor
Registered User
Posts: 2414
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [RC] Simple CDN Extension 1.0.4[updated]

Post by John connor »

Okay, another question. Your extrension uploads images to the CDN, but I use the AWS S3 extension for attachments here. Will this extension interfere with the AWS S3 extension?

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

Re: [RC] Simple CDN Extension 1.0.4[updated]

Post by davidyin »

John connor wrote:
Fri Dec 14, 2018 8:48 am
Okay, another question. Your extrension uploads images to the CDN, but I use the AWS S3 extension for attachments here. Will this extension interfere with the AWS S3 extension?

The extension interface has one input field, which is the CDN url. If you use your S3 storage for these files, I think you can just enter your s3 bucket URL. Make sure the folder structure is the same.

My question is, if you use our S3 directly, It has no benefits from the CDN.

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

Re: [RC] Simple CDN Extension 1.0.5[updated]

Post by davidyin »

New v1.0.5.
I improve the code and see if it OK.

Download link
https://www.phpbbchinese.com/viewtopic.php?f=19&t=816

User avatar
John connor
Registered User
Posts: 2414
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [RC] Simple CDN Extension 1.0.5[updated]

Post by John connor »

How can I prevent this from uploading attachments to Cloudfront? Since I use S3 for attachments already. It would be nice to have options to pick what gets uploaded to the CDN.

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

Re: [RC] Simple CDN Extension 1.0.5[updated]

Post by davidyin »

John connor wrote:
Sat Dec 15, 2018 9:14 am
How can I prevent this from uploading attachments to Cloudfront? Since I use S3 for attachments already. It would be nice to have options to pick what gets uploaded to the CDN.
This extension does not change anything about the uploading. You don't have to worry about it.

User avatar
John connor
Registered User
Posts: 2414
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [RC] Simple CDN Extension 1.0.5[updated]

Post by John connor »

I'll try to create a Cloudfront account and test this in my test domain.

User avatar
olalavui
Registered User
Posts: 103
Joined: Sat Dec 13, 2008 3:02 am
Location: Vietnam
Name: Bui Thanh Tung
Contact:

Re: [RC] Simple CDN Extension 1.0.5[updated]

Post by olalavui »

I have check console (F12) have error:

Code: Select all

Access to font at 'https://cdn.domain.com/assets/fonts/fontawesome-webfont.woff2?v=4.7.0' from origin 'https://domain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Can you help me?
Come back phpBB with phpBBVietnam

Post Reply

Return to “Extensions in Development”