• How can I get the WordPress REST api to respect W3 Total Cache settings for media?

    If I use a CDN in W3 Total Cache and create a page with an image, then WordPress correctly serves the page with the image URL pointing to the image in the CDN. If I request the page through the REST API then I the image URL points to my WordPress server, not the CDN

    e.g. Served directly from WordPress, the page contains
    <p><img src=\"http:\/\/123456789.cloudfront.net\/wp-content\/uploads\/2017\/09\/test-300x298.jpg\" ...

    but if I get the page from the REST API, then it contains:

    "content": {
    "rendered": "<p><img src=\"http:\/\/myserver.com\/wp-content\/uploads\/2017\/09\/test-300x298.jpg\" ...

    The server is on AWS. Ive set W3 Total Cache to push the media to an S3 bucket which is served by Cloudfront.

    Is there any way to set this up to use the CDN URL?

Viewing 1 replies (of 1 total)
  • olaflexemo

    (@olaflexemo)

    Just wondering if you found a solution for this? I see the exact same behavior. Using w3tc and MaxCDN.

Viewing 1 replies (of 1 total)
  • The topic ‘Using REST API to serve media through a CDN’ is closed to new replies.