Magento Disable CDN

To see URLs configured on a Magento 2 installation, run the following SQL command

select * from core_config_data where path like '%_url';

Example

mysql> select * from core_config_data where path like '%_url';
+-----------+---------+----------+------------------------------------+------------------------------------------------------------------------+---------------------+
| config_id | scope   | scope_id | path                               | value                                                                  | updated_at          |
+-----------+---------+----------+------------------------------------+------------------------------------------------------------------------+---------------------+
|        10 | default |        0 | web/unsecure/base_url              | https://buildingplans.com/                                             | 2021-11-09 19:39:03 |
|       200 | default |        0 | payment/braintree/descriptor_url   | NULL                                                                   | 2020-10-14 06:23:31 |
|       587 | default |        0 | web/unsecure/base_static_url       | https://621984-2039577-raikfcquaxqncofqfm.stackpathdns.com/pub/static/ | 2021-08-05 10:18:30 |
|       588 | default |        0 | web/unsecure/base_media_url        | https://621984-2039577-raikfcquaxqncofqfm.stackpathdns.com/pub/media/  | 2021-08-05 10:18:30 |
|       589 | default |        0 | web/secure/base_url                | https://buildingplans.com/                                             | 2021-11-09 19:39:03 |
|       591 | default |        0 | web/secure/base_static_url         | https://621984-2039577-raikfcquaxqncofqfm.stackpathdns.com/pub/static/ | 2021-08-05 10:18:30 |
|       592 | default |        0 | web/secure/base_media_url          | https://621984-2039577-raikfcquaxqncofqfm.stackpathdns.com/pub/media/  | 2021-08-05 10:18:30 |
+-----------+---------+----------+------------------------------------+------------------------------------------------------------------------+---------------------+
8 rows in set (0.00 sec)

mysql> 

In this case, the site use stackpath CDN.

To remove CDN, you can delete the entries related stackpathdns with SQL command

delete from core_config_data where path = 'web/unsecure/base_static_url';
delete from core_config_data where path = 'web/unsecure/base_media_url';
delete from core_config_data where path = 'web/secure/base_static_url';
delete from core_config_data where path = 'web/secure/base_media_url';

Now you need to re-deploy the static assets with

php bin/magento setup:static-content:deploy

clear cache

php bin/magento cache:flush
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *