Tech geek. Life geek.

Tag: CDN (Page 1 of 2)

CDN compare: Azure vs Cloudfront vs BelugaCDN

It is a test of the speed from CDN Edge servers to the multi-locations. It is very important the signal for the real experience of the users.

Let me see how I implement the tests.

  • I created two endpoints on the Azure CDN, on Microsoft CDN and Akamai CDN.
  • I created a CloudFront distribution on Amazon CloudFront.
  • I created a CDN property on BelugaCDN.

All these four CDN settings pointed to a custom origin of one of my sites, which hosted on DigitalOcean.

The file I used for testing is a JPG file, an image file.

The testing tool is provided by KeyCDN performance tool.

I run at least two tests to make sure most of the testing server can get the JPG file from the cache of the Edge server(CDN), not back to the origin server.

 

Azure CDN: Standard Microsoft Tier

Standard Microsoft Tier CDN

 

The results are base on the 14 tests from different locations globally. I care about the TTFB much more than others.

What is TTFB

TTFB, which stands for time to first byte, is the amount of time it takes from when a client makes an HTTP request to it receiving its first byte of data from the web server. TTFB is an important aspect of website optimization since the faster the TTFB, the faster the requested resource can start being delivered to the browser.

The time to first byte is made up of three separate components.

  • The time needed to send the HTTP request
  • The time needed for the server to process the request
  • The time needed for the server to send back the first byte of the response to the client

What is a good TTFB?

The time to first byte can vary greatly depending on what sort of content you are serving (static vs dynamic), your server’s configuration, etc. Therefore determining what is a good TTFB number is difficult to answer and is variable based on your situation. However, on average anything with a TTFB under 100 ms is fantastic. Anything between 200-500 ms is standard, between 500 ms – 1 s is less than ideal and anything greater than 1 s should likely be investigated further.

As mentioned, it should be noted that these times are average benchmarks, however do not apply to all websites. Depending on the type of content and complexity of the application it may be completely unavoidable that the TTFB is greater than 1 second

Continue reading

Small PHP 7.2 Compatibility Bug of W3 Total Cache

When I upgrade my php to php 7.2, I saw a lot of error log in the log file.

[error] 1502#1502: *625 FastCGI sent in stderr: “PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /<purged>/wp-content/plugins/w3-total-cache/Cdn_Plugin.php on line 1203” while reading response header from upstream, client: 135.0.172.188, server: www.yinfor.com, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php7.2-fpm.sock:”, host: “www.yinfor.com”

 

It is a bug or error, or just a compatibility issue between php 7.2 and W3 Total Cache.

Based on the the dissus on the WP site, TeroSalminen has a workaround.

Replacing a line in “function get_replaced_urls()” seems to work:

Replace the line
if ( count( $this->_replaced_urls ) ) {
with
if ( $this->_replaced_urls && count($this->_replaced_urls) ) {
and test.

Amazon CloudFront adds Canadian edge servers

It is good to know that Amazon AWS service adds new edge locations in Montreal and Toronto for Cloudfront. I hope it will be soon to have a new edge in Canada West, such as Vancouver.

cf_toronto_2

Amazon CloudFront adds new edge locations in Montreal and Toronto, our first in Canada

We are pleased to announce the launch of our newest edge locations in Toronto and Montreal, our first edge locations in Canada. Adding locations in Canada has been frequently requested by our customers so we are excited to add these two locations to our global network. If you’re already using Amazon CloudFront, you don’t need to do anything to your applications as requests are automatically routed to these locations when appropriate.

These new edge locations help improve performance and availability to end users of your applications and support all Amazon CloudFront features at no additional cost. Pricing for the new edge locations in Canada is the same as that in the US.

We have also added a second edge location in Sao Paolo, Brazil, our third edge location in Brazil. With the addition of the new locations in Canada and the second edge location in Sao Paolo, Amazon CloudFront now has a total of 59 edge locations worldwide. To see a list of all Amazon CloudFront global edge locations, please see our edge location list. To learn more about the service, attend a monthly office hour session that includes Q&A with Amazon CloudFront Engineers and Product Managers. Visit Amazon CloudFront for more information and register for the next office hour.

Continue reading

Dirty Hack: Add CDN support into phpBB 3.1.6

It works for phpBB 3.1.x, not just phpBB 3.1.6. For a national forum or global forum, it is a must to have a CDN support.

The way I used is not a formal extension or plugin. It is a hack, actually a dirty hack. If you have no experience for it, you can close this page now.

Now, let’s start.

  1. Backup everything of your phpBB, include files and database.\
  2. URL path example.
    Forum url is http://www.myforum.com/
    CDN url is http://myforum.kxcdn.com/
  3.  Open /includes/functions.php
    add following in line 5112

    // Add CDN path
    $cdn_cache = '//myforum.kxcdn.com/';

    Find following around Line 5216

    'T_ASSETS_PATH'         => "{$web_path}assets",
    'T_THEME_PATH'         => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme',
    'T_TEMPLATE_PATH'      => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
          

    Replace by

    'T_ASSETS_PATH'         => $cdn_cache."assets",
    'T_THEME_PATH'         => $cdn_cache."styles/" . rawurlencode($user->style['style_path']) . '/theme',
    'T_TEMPLATE_PATH'      => $cdn_cache."styles/" . rawurlencode($user->style['style_path']) . '/template',

    Find following around Line 5230

    'T_STYLESHEET_LINK'      => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
    'T_STYLESHEET_LANG_LINK'    => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],

    Replace by

    'T_STYLESHEET_LINK'      => $cdn_cache."styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
    'T_STYLESHEET_LANG_LINK'    => $cdn_cache."styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],

    Save and overwrite the original file.

  4.   Open /includes/functions_content.php
    Find following around Line 902

    return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);

    Replace by

    return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' .'//forum.kxcdn.com/forum/'.$root_path. $config['smilies_path'] . '/\2 />', $text);

    Save and overwrite the old file.

  5. Then purge cache in the ACP.

Look at the waterfall chat after this hack.

cdn-phpbb-hack

The CDN service provider is KEYCDN. You can apply through this link.

CDN77.com – API 2.0 Release!

Got email from CDN77. It announced that API 2.0 released.

Much more API features are now available. We worked hard so that we could give a positive answer to your most frequent questions:

“Can I create / edit / delete a CDN resource through API?”

YES! You can manage your CDN resources (incl. Live Streaming) easily with API.

“Can I integrate the reports to my internal tools using API?”

YES! All the data we provide you with in the Reports section + Logs are now reachable through API.

“Can I make changes to my account via API?”

YES! You can edit all the account details including the billing and invoicing section.

cdn77-api-2

More details of API 2.0, check the Documents.

CloudFront has Reports now

Amazon announced that CloudFront Usage Charts is available in Report and Analytics.

We are excited to let you know that you can now view your Amazon CloudFront usage with CloudFront Usage Charts, six new charts in the AWS Management Console. You can use the charts to track trends in data transfer and requests (both HTTP and HTTPS) for each of your active CloudFront Web distributions. The charts show your usage from each CloudFront region at daily or hourly granularity, going back up to 60 days, and they also include totals, average, and peak usage during the time interval selected.

Here are details on the six charts:

  • Number of HTTP Requests; Number of HTTPS Requests: These two charts (one for HTTP and one for HTTPS) show the number of HTTP or HTTPS requests served by edge locations in the selected region for the specified CloudFront distribution.
  • Data Transferred over HTTP; Data Transferred over HTTPS: These two charts (again, one each for HTTP and HTTPS) show the total amount of data transferred over HTTP or HTTPS from CloudFront.
  • Data Transferred from CloudFront Edge Locations to Your Users: This chart shows data transferred from CloudFront edge locations in the selected region to users, combining both HTTP and HTTPS usage.
  • Data Transferred from CloudFront to Your Origin: This chart shows data transferred from CloudFront edge locations in the selected region to your origin for POST, PUT PATCH, OPTIONS, and DELETE methods, again combining both HTTP and HTTPS.

 

cloudfront-report

Continue reading

Go back to Amazon AWS CloudFront

I start to use CDN from April 2010, with MaxCDN. Later, I moved to Amazon, FrontCloud in August, 2010.
For some reason, I move back to MaxCDN. I start to use MaxCDN again from June 2012. In April 2013, I started to use CDN77.
A few days ago, in March 2014, I go back to Amazon AWS CloudFront. It is a reliable CDN service provider. The price is pay as you go. Based on my network volume, I prefer this price structure.

I setup CloudFront with custom origin server. Add CNAME on it. One of the CDN rules is to use two CDN host name, not one, not three. Two is the perfect number and best performance.

I tested my new CloudFront CDN ping value through CA ping tool. There are over 30 monitoring stations worldwide. My testing result is:

  • AWS CloudFront CDN,

Average: 48.29
Median: 3.05

  • CDN77 CDN

Average: 51.69
Median: 20.15

It shows that CloudFront has better ping value.

The original testing data link.

Testing tool provided by CA Technologies. http://cloudmonitor.ca.com/en/ping.php

ca-ping-tool

Continue reading

Webfont doesn’t shown in Firefox 22

I have a site which is using web font in css. It looks good in Chrome, IE, etc., except Firefox. It just shew a square with the number, something like F052.

I did a lot of search and it took me about 4 hours, until now I got the solution.
It is only happened on cross domain resource.
It is only happened on Firefox.
It is only happened when using CDN.

When I use Firebug to look at the pipe, the woff web font file is aborted. The url is corrected.

Catalin Rosu gave the solution in this post.

Firefox doesn’t allow cross-domain fonts

Continue reading

Change CDN service provider to MaxCDN

I start to use CDN from April 2010, with MaxCDN. Here is the first post I mentioned it.
Later, I moved to Amazon, FrontCloud in August, 2010.
For some reason, I move back to MaxCDN. I start to use MaxCDN again from last week.
It is easy to implement MaxCDN.
The price is good, if you have a big volume or bandwidth requirement.
You can have One TB = 1000GB for $39.95.
And 30 day Money-Back Guarantee
No Monthly Fee

Continue reading

« Older posts

© 2020 David Yin's Blog

Theme by Anders NorenUp ↑