Knowledge Base

How to move all assets to an object storage and serve via a CDN?

You can easily upload all static files to an object storage of your choice and service it via a CDN. Currently Premium URL Shortener fully integrates direct upload to an object storage such as AWS S3, Digitalocean Spaces and many others. 

Step 1 - Setup credentials

You can set up your account and credentials by following the guide for the respective object storage at 

Step 2 -  Sync existing uploaded contents

Once the setup is done, you can sync all uploaded files directly from the admin panel where you setup your credentials

Step 3 - Upload static assets files

While the sync feature uploads all files uploaded by users, it does not upload static assets. You will need to upload those manually. Login to your hosting control panel or FTP to your server. Go to /public/ folder and compress the "static" folder. Download and upload all files in the static folder to the object storage storage of your choice. Once that is done, go to the file config.php and you will see the following line: 

define("CDNASSETS", null);

Replace null by a the url to the static folder - make sure to add the static folder at the end e.g. https://mycdnendpoint/static


define("CDNASSETS", "https://mycdnendpoint/static");

Now all of your files will be served via the CDN. New uploaded files will be automatically uploaded to the object storage and served via the CDN.

Was this helpful? 😃 😞

Still have questions?

If you still have questions, feel free to open a ticket and we will gladly help you out!

Open a ticket