Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Goossens

    (@futtta)

    all indeed seems to be working as expected Stu, except for the fact that the autoptimized file can’t be found on the CDN-url.

    your CDN indeed works for your images;
    https://12flat.com/wp-content/uploads/2017/01/12flat-logo-drop.png
    https://cdn.12flat.com/wp-content/uploads/2017/01/12flat-logo-drop.png

    but it does not seem to work for the autoptimized JS:
    https://12flat.com/wp-content/cache/autoptimize/js/autoptimize_6a5d6184c93627baf50d55092e8d23c2.js
    https://cdn.12flat.com/wp-content/cache/autoptimize/js/autoptimize_6a5d6184c93627baf50d55092e8d23c2.js

    so how did you set up your CDN?

    frnak

    Thread Starter dblinks

    (@dblinks)

    Hi and thanks.

    I pointed an A record for cdn.12flat.com in DNS to the IP of my server and created a path to it with my ssl and port. The path to my subdomain folder is /srv/12flat-images/ (as opposed to /srv/12flat/ which I have a copy of /wp-content and /wp-includes within. I looked in the db to find where AO specifies the path but you must be just grabbing that from wp so I cannot override.

    In DB (for images) working fine.
    upload_path – /srv/12flat-images/wp-content/uploads
    upload_url_path – https://cdn.12flat.com/wp-content/uploads

    Within the plugin (CDN Enabler)
    CDN URL
    https://cdn.12flat.com
    Included Directories
    wp-content,wp-includes
    Relative Path (default: enabled).

    • This reply was modified 9 years, 1 month ago by dblinks. Reason: for notify
    Plugin Author Frank Goossens

    (@futtta)

    ah, now I understand; AO expects the CDN to mirror the directory structure of the origin site (as a typical pull CDN works) and that files cached in the origin server are automatically available on the CDN (again; pull CDN).

    if however you have a subdomain that points to a different place on the filesystem which is not in sync with the normal wordpress filesystem (specifically changes made in wp-content/cache/autoptimize) then this indeed will not work (as you’re not in a pull CDN scenario there).

    maybe symlinking /srv/12flat/wp-content/cache to /srv/12flat-images/wp-content/cache can be a simple workaround?

    Thread Starter dblinks

    (@dblinks)

    I can symlink via cli but would rather hard code it in a nginx server block via a custom .conf file as I don’t want any conflicts with other sites on this machine.

    I’m not exactly sure the syntax yet in that .conf file to pair/symlink them.

    Thanks for your suggestion Frank.

    Plugin Author Frank Goossens

    (@futtta)

    if you can configure nginx to look at /srv/12flat-images/wp-content/ by default for the cdn subdomain, but at /srv/12flat/wp-content/cache/autoptimize for requests containing cache/autoptimize, then you’d be out of the woods. don’t know the first thing about nginx though … 🙂

    Thread Starter dblinks

    (@dblinks)

    OK, so this is interesting (based on your last conclusion). In AO I made //12flat.com/ the cdn and left https://cdn.12flat.com as the domain for the CDN Enabler plugin.

    No error on the AO js file now… all other assets are using the cdn.

    Your support exceeds expectations and suggestions push me to find ways to improve.

    5 stars.

    Thread Starter dblinks

    (@dblinks)

    Probably will work just leaving the cdn blank in your plugin. As you said I’m not using “pull” so until I figure that out the site is performing well enough.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Cache Folder path’ is closed to new replies.