Using PageCDN with your website requires that you:
activate your account. Private CDN features require paid subscription;
create one or more repos to pull content from your website;
modify your website code to use the CDN.
Its easy to create and configure these repos manually. And, if you have a WordPress website, things are much easier as our plugin can automate most of the tasks.
To create a repo, please go to the Dashboard and follow these steps:
Click the 'Create New' button on top bar.
A popup will open where you have to choose between private and shared repos. For most uses, you will need to create a private repo.
Choose whether you want to pull contents from website, github or you want to manually upload files to the repo.
In case the origin is a github repo or a website, provide 'Origin URL' that may be the URL of your github repo or your website. You can provide the website base as origin like
https://example.com or can also refer to a directory like
https://example.com/path/to/static/files/. This helps you shorten the path if you want to fetch files from a single directory that is very deep in hirerarchy. For github repos, you have to provide the repo path that may look like:
https://github.com/jquery/jquery. PageCDN can work with both public and private github repositories.
Provide an easy memorable name for repo in 'Repo Name' field.
Choose a URL friendly repo slug for use in 'Repo Path'.
In case of shared repo, you may also need to choose a 'Namespace' and optionally provide 'keywords'.
Click 'Create Repo' button to finish the setup.
Once the repo is created, you are taken to 'My CDN' page where you can see list of recently created repos. In the 'CDN URL' column, you can see a copy button to the left side of a box that displays a URL. This URL represents your CDN repo. All you have to do is to copy this CDN URL and use use it in place of the origin URL you provided during the setup.
If you choose 'Github' origin, please skip to the 'Setting up a GIthub repo' section below.
If you choose 'Manual Uploads' origin, please click on 'View Files' button next to the repo you created and click on 'Upload Files' on next page to upload files. Once the file uploads are complete, you may need to refresh the page to see the files you uploaded. Clicking on each file will give you the URL that you can use on your website.
Using our WordPress plugin, setting up CDN for your WordPress website is very simple and mostly effortless. You do not even need to configure anything on PageCDN to connect to your website. The plugin does everything for you.
To use WordPress plugin, please create and activate your account. PageCDN WordPress plugin requires API access to create repo, to create most optimal content delivery strategy and to purge CDN cache. PageCDN WordPress plugin helps with automatic Public CDN integration too.
To integrate PageCDN with your WordPress website, please follow these simple steps:
On PageCDN, go to Settings → User Profile and copy the API key.
On your website, install PageCDN WordPress Plugin.
Activate the plugin.
In WordPress admin panel, goto the Settings -> PageCDN page.
On settings page, paste the API key in the relevant field.
Go to your public website and test the changes.
If at some point you may need to flush the CDN cache. For this, there is a purge button avilable on the admin bar. Clicking that button will flush the cache and will force PageCDN to fetch fresh files from your website.
After this, your WordPress CDN setup is complete and in most cases you may not need to change the configuration any further. The default settings provide the configuration that usually work with any any website. But if you want to understand or optimize things further, you may need to continue reading how things work behind the scenes.
For a simple setup, you do not need to create a repo at PageCDN before integrating with your WordPress website. However, if you already have a repo created and optimized your way, you may use its URL on the PageCDN settings page in your WordPress Admin area. Manually creating a repo for WordPress website usually offers no extra benefit than just choosing a memorable name for use in CDN URL, because with the default automated WordPress setup, a random hashed repo URL like the following one is created:
https://pagecdn.io/repo/c6c0c20c4e6371a8fe47. You may also choose to make it a shared repo, and choose different namespace than the word
repo in URL.
The default settings are usually good for most setup, but you may need to optimize HTTP Caching, Edge Caching, Compression, Server Push and other settings for your website.
Please login to PageCDN.
Click 'My CDN' page on the top bar.
On 'My CDN' page, you will see a list of repos that you created in the past. If there are multiple repos, you may need to look at the Origin column to understand which repo is relevant to the setup you are currently working with. After identifying the repo, Click 'View Files'.
On next page, click 'Settings'.
A popup will open. Click on 'Configure' to open the configuration form that helps you customize the setup.
More information on how to optimally configure a repo is available in Configuration Guide.
Google Fonts is an excellent fonts collection that is available for free for any website. These fonts and CSS files are served through a CDN for super fast delivery. However, there are some limitations that we try to cover through Easy Fonts library. If you want to try Easy Fonts, you will need to enable 'Use better cacheable fonts from PageCDN' option on plugin settings page.
Enabling the option will try to replace all references to Google Fonts CSS with PageCDN hosted Easy Fonts.
A WordPress website consists of the WordPress core, some plugins and a theme. All of these usually contain opensource resources like jQuery, Bootstrap, Angular, Font Awesome, etc. Serving these resources, along with other website files, over a CDN can make your website to load quicker. However, its better and more optimal to use Public CDN for such opensource resources for the two reasons:
Public CDN is free. You can save some bandwidth costs by serving these resources from Public CDN.
Resources over Public CDN are more likely to be in browser cache for even first time visitors because visitors' browser may already have received and cached such public files while visiting some other website. This can significantly speedup page load time.
PageCDN WordPress plugin full supports working with opensource resources and if you enable 'Optimize Opensource content' option in plugin settings, it will try hard to offload as many resources to Public CDN as possible.
Our Public CDN hosts developement and production (minified) versions of files of many opensource libraries, themes, etc. If a plugin or theme that you use uses an un-minified version of an opensource library, PageCDN plugin may be able to find a matching minified file for you if you enable the option 'Use minified public files where possible'.
You can setup a repo to connect to a github repo. By default, PageCDN works with releases and fetches files from github for:
Only fresh releases if you properly setup a github hook.
Old releases if you sync old files. However, in this case, it syncs just production releases and skips all releases that have
alpha or similar keywords that indicate a non-production release.
However, you can create a repo with 'Website' Origin and use
https://raw.githubusercontent.com/ as origin URL to get access to every commit or branch of your repos that you want to use, and then configure your repo on PageCDN to apply your own caching and compression configuration.
The initial repo setup process for Public Github Repos is the same as described in 'Creating Repos' section above. Once created, you can open it by clicking 'View Files' button. After that, you will see a 'Sync Files' button clicking which syncs all production releases available on that github repo till date.
However, you may want to automatically pull new releases as they are created on github. This requires some additional steps:
On 'My CDN' page, click on 'View Files' link next to the repo you are working on.
This will open a popup box. Next copy the 'Webhook URL' available in the popup box.
Go to your Github repo.
In the navigation on left side, click 'Webhooks'.
On next page, click 'Add Webhook'.
Paste the Webhook URL in 'Payload URL' field.
application/json 'Content Type'.
Click on 'Let me select individual events' option.
It will open a list of events that Github can send through API. Here you have to uncheck all the events and check only 'Releases' event.
Click on 'Add Webhook' to complete the setup.
Once done, Github will notify PageCDN of all the releases created on this Github repo and PageCDN will be able to fetch files as and when they are available.
The process of setting up PageCDN repo with Private Github Repos is the same as for the Public Github Repos above, with the following extra steps:
Open your Github Developer Settings, and go to 'Personal Access Tokens' page.
Click on 'Generate New Token'.
In the 'Note' field, type some text like 'PageCDN Access Token' for your reference in the future.
In the 'Select Scope' area, Check 'Repos' and its child options.
Click 'Generate Token'.
It will generate a token on the next page and display it only once. Please copy that token.
Goto Profile Settings on PageCDN.
In the Github Personal Access Token section, paste the token and save.
Test the setup by creating a test release on Github. PageCDN will have access to all the Github repos that you have access and any releases created on Github will be available on PageCDN within seconds.