WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] Problem With CDN & CSS (4 posts)

  1. ifoman
    Member
    Posted 3 years ago #

    My theme's CSS files aren't being read correctly from Amazon CloudFront where I've copied my files, so my site doesn't display correctly. Troubleshooting the problem, if I try to browse a CSS file directly in the browser, it downloads to my computer, rather than being displayed in the browser (which is how I think it should normally behave). If I exclude CSS files from being served using menu option, then all other file types are properly served from the CDN. All the permissions on CloudFront seem to be correct, but those pesky CSS files aren't being served correctly.

    Second, why should .php files be routinely excluded from CDN delivery, as recommended? Seems like that .php files constitute the bulk of the wp-includes and wp-content directories. What are the consequences of serving .php from the CDN? Thanks!

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. markb1439
    Member
    Posted 3 years ago #

    Regarding PHP:

    PHP generally is NOT served via CDN. CDN is meant to serve static content, as opposed to dynamic content such as PHP. In fact, CDN servers generally do not process PHP. So, if you are directing PHP URLs to the CDN, the PHP will not be executed. In summary, you'll have a big mess on your hands.

    So the idea is that your web server handles the dynamic content, while static items are served from the CDN.

    Best regards,

    Mark Bailey
    WPCDN

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    ifoman - it's weird that the css files wouldn't be served from the CDN with the correct headers. I wonder why? Have you found anyone else who had the same general problem?

  4. ifoman
    Member
    Posted 3 years ago #

    Solved - I was uploading files to Amazon S3 with Transmit, a program I've used for years. But apparently it wasn't writing the files correctly. I used Cyberduck to make the FTP transfer, and now everything works as it should.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic