CDN Beget
This add-on is part of our Subscription plan.
Subscribe once — enjoy all add-ons without limits.
The add-on adds Beget to the standard CS-Cart CDN settings. Connect a CDN domain created in the Beget control panel, verify that it is reachable, and manage static file delivery from the store administration panel.
What it is for
- Speed up image, CSS, and JavaScript delivery through nearby CDN edge locations.
- Connect Beget without modifying the standard CS-Cart CDN page.
- Store the selected CDN provider in the store configuration.
- Switch between Beget and Amazon CloudFront from one interface.
Key features
- Beget or Amazon CloudFront selection on the standard CDN page.
- Beget connection through the domain of an existing CDN resource.
- Beget domain availability check before static file delivery is enabled.
- Validation of required fields for the selected provider.
- Persistent provider selection in the CS-Cart configuration.
- Automatic fallback to CloudFront when the add-on is disabled or removed.
How it works
First, create a CDN resource in the Beget control panel and obtain its domain. Then select Beget in the CS-Cart CDN settings and enter that domain. The add-on checks whether the store's system JavaScript file is available through it. After a successful check, enable CDN so static resources start loading through the Beget address.
CloudFront uses its standard access credentials. Disabling the add-on changes the CS-Cart provider to CloudFront, but it does not remove or disable the resource in the Beget control panel.
Have questions about the add-on?
- Store Builder
- Store Builder Ultimate
- Multi-Vendor
- Multi-Vendor Plus
- Multi-Vendor Ultimate
- Owners
- English
- Русский
- 4.20
- 4.19.X
- 4.18.X
- 4.17.X
Instructions for CDN Beget
The add-on adds Beget to the standard CS-Cart CDN settings. Create and configure the CDN resource in the Beget control panel first; the add-on connects its domain to the store, checks availability, and passes static file delivery to the standard CS-Cart CDN mechanism.
What the add-on does
- Lets you select Beget or Amazon CloudFront as the current CDN provider.
- Connects Beget through the domain of an existing CDN resource.
- Validates the required fields for the selected provider before saving.
- Normalizes the Beget address by removing
http://,https://, and a trailing/. - Checks Beget availability at
/js/tygh/core.js. - Writes the selected backend to
config.local.phpand applies it to the current request without restarting the store. - Restores the CloudFront backend when the add-on is disabled or removed.
What to prepare before configuration
- Create a CDN resource in the Beget control panel and obtain its domain, for example
example.begetcdn.cloud. - Set the store as the resource origin in Beget and make sure
/js/tygh/core.jsis available through the CDN. - For an HTTPS storefront, prepare a valid certificate for the CDN domain.
- Make sure
config.local.phpexists and is writable by the web server.
Create a CDN resource in the Beget control panel, set the store as its content origin, and select the delivery domain.
The add-on field requires only the CDN domain, without a file path. You can paste the address with or without a protocol; the protocol and trailing slash are removed when the form is saved.
Where to find the add-on
Main configuration page: Administration → Storage → CDN.
There is no separate settings form in the add-on card. The standard CDN page contains the provider selector, connection fields, status, and static file delivery controls.
Open the Storage section in the CS-Cart settings.
On the Storage page, open the CDN settings tab.
Fields and statuses on the CDN page
- Provider. Selects the CDN backend: Beget or Amazon CloudFront.
- CDN URL. The domain of an existing Beget resource, for example
example.begetcdn.cloud. Do not add a directory or file path. - Key and Secret key. Amazon CloudFront credentials. These fields apply only to CloudFront and are not used by Beget.
- Status. For Beget, the add-on requests
/js/tygh/core.jsover HTTPS first and HTTP second. The technical check considers the host reachable when it receives an HTTP status from 200 through 502. Therefore, Active confirms that the host responds but does not replace a storefront file check. - Enable CDN. Passes static file delivery to the standard CS-Cart CDN mechanism. The checkbox appears after the CDN domain is saved and remains unavailable until the availability check returns an active status.
Connect Beget CDN
- Complete the resource configuration in the Beget control panel and copy its CDN domain.
- Go to Administration → Storage → CDN.
- Select Beget in the Provider field.
- Replace the previous value in CDN URL with the Beget domain. This is especially important when switching from CloudFront because the form uses shared saved CDN data.
- Save the changes. The add-on validates the field, normalizes the domain, and requests
/js/tygh/core.js. - Check the status after the page reloads. If it is In progress, fix the CDN domain or origin configuration before continuing.
- When the status becomes Active, select Enable CDN and save the changes again.
- Check storefront file delivery as described below.
Select Beget, enter the CDN URL, wait for the active status, and enable CDN.
If you change only Provider without editing its fields, the add-on switches the backend using the already saved CDN data. When configuring a provider for the first time, fill in its fields before saving.
Switch to CloudFront
- Select Amazon CloudFront on the CDN page.
- If CloudFront is being configured for the first time or its credentials have changed, fill in Key and Secret key.
- Save the changes and wait for the standard CS-Cart CloudFront configuration result.
- If the backend is active, select Enable CDN when needed and save the changes again.
When the provider changes, the add-on calls the standard disable operation for the current CDN backend and then applies the new one. For Beget, no external disable request is sent, so the resource remains in the Beget control panel. When switching from CloudFront, check the distribution state after the change.
The selected provider is stored in config.local.php. If the file is not writable, CS-Cart displays an error; correct the permissions and save the form again.
What happens when the add-on is disabled
CloudFront becomes the current backend in the CS-Cart configuration again. The add-on does not call the Beget API and does not disable or delete the external CDN resource; manage that resource separately in the Beget account if necessary.
How to check the result
- On the CDN page, make sure Beget is selected, the status is Active, and Enable CDN is selected.
- Open
https://your-cdn-domain/js/tygh/core.jsand make sure the server returns the JavaScript file itself rather than an error or service page. - Open the storefront and the browser developer tools, then go to the Network tab.
- Reload the page and check image, CSS, and JavaScript URLs: the requests should use the Beget domain.
- Check several storefront pages and make sure CDN requests have no 4xx/5xx errors or mixed HTTP/HTTPS content warnings.
- Clear the CS-Cart and browser caches and repeat the check if old resource URLs remain in the HTML.
- For a technical check, open
config.local.php: when Beget is selected, it should contain$config['cdn_backend'] = 'beget';.
If CDN does not work
- The status remains “In progress”. Check the CDN domain DNS, certificate, Beget origin settings, and the direct response from
/js/tygh/core.js. The add-on tries HTTPS first and HTTP second. - Enable CDN is unavailable. Resolve the availability check first: the interface blocks the checkbox until the domain becomes active.
- The provider is not saved. Check that
config.local.phpexists and is writable, then save the form again. - A required-fields message appears. Beget requires CDN URL; CloudFront requires both Key and Secret key.
- The status is active, but files still load from the store domain. Check Enable CDN, save the form, and clear the CS-Cart and browser caches.
- Files return an error or incorrect content through CDN. Check the resource origin, path rules, and HTTPS settings in the Beget control panel. An active status alone does not confirm correct delivery of every file.
- The resource remains in Beget after switching providers. This is expected: the add-on does not manage the external resource through the Beget API.
Change history
v1.0.0 from 2025-11-20
[+] Initial release
Legend:
[+] Added
[-] Removed
[*] Changed
[!] Bug fix
Here you can share your opinion and evaluate our work.
Your feedback helps us become better and offer you even better service.