-
@OneEagle there is no setting to have different URLs for static files like css/js, they are not storing on Wasabi and shouldn't be affected by recent Wasabi change. For the storage files, which you are storing on Wasabi, it's possible to have CDN with different domain in Studio > Settings > Storage > AWS custom domain (require custom DNS setup):
So you need to specify myhostname.cdnhere.com in this field.
-
Dear @Alex T⚜️
Thank you so much for your reply. You guys from UNA are just amazing and smart. I am really impressed! You built UNA with flexibility in mind. I have never thought that the 'AWS custom domain' option was introduce to address cases like mine.
So, I proceeded and I created a CNAME for my AWS custom domain.
I referred to your post found here:
https://unacms.com/cmts-view/1e6ah1f?sys=bx_forum&cmt_id=1718
and to the Amazon docs on 'Customizing Amazon S3 URLs with CNAME records' you shared there which is found in this link:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#VirtualHostingCustomURLs
Also, I remembered that the CDN service has a Custom Hostname setting. So the process was quite simple and easy.
After doing everything, guess what! It works. Just BRILLIANT!!!! You guys are good in what you do. Files on my remote storage are now displaying back on UNA. I am so excited. Thank you very much for your assistance.
Regarding static files on my server (js/css/jpg/svg/png etc), I would like to mention that I ended up subscribing for two CDN services: One for my remote storage and another one for my Website. They are two separate services. I wanted both of them not only to be cached to increase speed and save bandwidth but also to be protected by all the security measurements offered by CDN services (DDoS Attack Mitigation, Real-time threat detection, Web Application Firewalls - WAF etc.). Most of CDN services also offer features that can improve SEO.
I have also signed up for their DNS Service which also comes with some good DNS caching and acceleration options and all the security measurements I mentionned above.
What I would like to achieve as requested by the CDN service is to change my static files Urls and point them to my CDN hostname. It's an extra layer of caching that will further improve website performance.
So, instead of having links like:
- https://www.mywebsitehere.com/template/images/splash.png
- https:// www.mywebsitehere.com/gzip_loader.php?file=bx_templ_css_856ekd492ea06bc4d6ae52.css
I should have:
- https://myhostname.cdnhere.com/template/images/splash.png
- https://myhostname.cdnhere.com/gzip_loader.php?file=bx_templ_css_856ekd492ea06bc4d6ae52.css
The CDN service will cache and speed up the loading of these files.
That's why I asked if this change can me made in the code. I don't mind editing the core code and re-applying the change whenever UNA updates. As long as it works, I am fine.
As I said in my previous message, most of the CMS like Wordpress, Joomla, Drupal etc already have a CDN plugin that does that. It automatically convert all the static and remote files urls and points them to the CDN Hostname.
We should have such a feature if we would like to improve UNA-based website's speed, security and SEO.
What do you think?
Thanks for the great work the UNA Team has been doing.
-
That's why I asked if this change can me made in the code. I don't mind editing the core code and re-applying the change whenever UNA updates. As long as it works, I am fine.
Ok, in this case you can try to change the following two lines in `inc/params.inc.php` file:
... define('BX_DOL_URL_CACHE_PUBLIC', BX_DOL_URL_ROOT . 'cache_public/'); ... define('BX_DOL_URL_BASE', BX_DOL_URL_ROOT . 'template/'); ...
Try to change `BX_DOL_URL_ROOT` to you CDN domain name, also you will need to disable the following setting in Studio > Settings > Cache > Enable compression for JS/CSS files(cache should be enabled), to server files directly from `cache_public` folder instead of using `gzip_loader.php`.
-