Forum

Thread tagged as: Problem, Configuration, Third-party

Latest version of Perch and KeyCDN

KeyCDN offer Perch integration, however it doesn't appear to be working with the latest version of Perch.

Here are their instructions: https://www.keycdn.com/support/perch-cdn-integration/

I have an image field set up in Perch however the link appears to be relative: https://i.imgur.com/VDKWHcH.png

It doesn't use the CDN, although every other area works fine (images that are linked in the CSS for example works fine). This image is the only problem, the majority of the site is static.

The only thing that I have changed with my Perch setup is that the "perch" folder (website.com/perch) is called "cms" (website.com/cms).

I reached out to KeyCDN's support and they said: \ Taking a look at the code it for outputting the image it might be that relative links are in use when images are being pulled from cms / resources / folder or that the folder was changed to the images folder on the root of perch. \

Diagnostic:

Perch: 2.8.32, PHP: 5.6.22, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_kraken (1.0)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /cms
PERCH_PATH: /var/sites/l/ldomain.com/public_html/cms
PERCH_CORE: /var/sites/l/domain.com/public_html/cms/core
PERCH_RESFILEPATH: /var/sites/l/domain.com/public_html/cms/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /var/sites/w/www.domain.com/public_html
HTTP_HOST: www.domain.com
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
James B

James B 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I can see in your Diagnostics that your PERCH_RESFILEPATH is not pointing to the CDN (as described in their instructions). What do you have set in perch/config/config.php for that setting and what is defined for your resource buckets?

James B

James B 0 points

The bottom part of the config.php file is:

~ define('PERCH_TZ', 'Europe/London');

define('PERCH_EMAIL_FROM', 'james@domain.com');
define('PERCH_EMAIL_FROM_NAME', 'James Bertram');

define('PERCH_LOGINPATH', '/cms');
define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');

define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
define('PERCH_RESPATH', 'https://cdn.domain.com' . PERCH_LOGINPATH . '/resources');

define('PERCH_HTML5', true);~

I haven't created anything for resource buckets...perhaps this is the issue?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you re-saved your content since making the config change?

James B

James B 0 points

Drew McLellan said:

Have you re-saved your content since making the config change?

Thanks Drew, I totally overlooked that. It does appear however that I need to go in and click save on every single occurrence of that image element. I wish there was an easier way, however I guess I'll only have to do it once.

Thanks again guys :)

Drew McLellan

Drew McLellan 2638 points
Perch Support

Just use the Republish feature - that's what it does.