WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
CDN not working (24 posts)

  1. Raphael Suzuki
    Member
    Posted 1 year ago #

    Hi.

    The CDN rewrite feature seems to be not working.

    Is it Apache based?

    I'm asking because I'm using Nginx.

    http://wordpress.org/extend/plugins/autoptimize/

  2. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Don't think the rewrite is Apache-specific, but done entirely in PHP. But I'm not familiar with the CDN-rewrite code yet to be honest (I took over maintenance from the original developer a couple of months ago), I'll dive in to see how it works.

    Some questions;

    • Did you activate JS, CSS or image CDN?
    • Do you use any kind of caching (e.g. WP Super Cache plugin) and if so did you clean the cache?
    • Did you just see your normal URL's in the resulting HTML after activating the CDN-config? Or were the URL's broken? Or were some OK and others not?
  3. Raphael Suzuki
    Member
    Posted 1 year ago #

    Hi, Futta, and thanks for the fast response.

    Did you activate JS, CSS or image CDN?

    I've done tests with them all enabled and with each individually enabled. None of them seems to work.

    Do you use any kind of caching (e.g. WP Super Cache plugin) and if so did you clean the cache?

    I don't use any type of WP-specific cache, but I do use APC on my server, with "apc.stat" directive set as "1".

    Did you just see your normal URL's in the resulting HTML after activating the CDN-config? Or were the URL's broken? Or were some OK and others not?

    Nothing's changed, actually.

  4. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    OK, did a quick test on my test-blog and Autoptimize's CDN code seems to work for me, so it's probably something specific to your configuration. Can you list of all of Autoptimize's settings here (or in a mail to futtta-at-gmail-dot-com)?

  5. Raphael Suzuki
    Member
    Posted 1 year ago #

    My configuration is as follow:

    - HTML and CSS minify;
    - All CDN options: js.mysite.com, css.mysite.com, media.mysite.com;
    - Disabled file compress (doing it with Nginx).

    I've made this tests with two different sites. In one of them I disabled all other plugins, without success.

    Maybe this is something to do with my server?

    - PHP 5.4.6 + APC
    - MariaDB 5.5.29
    - Nginx 1.2.1 + PHP-FPM

  6. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    The server-stack should not have anything to do with the problem, as the replacement of URL's with CDN URL's is done with pretty straightforward PHP preg_replace's.

    But I'm working on some issues with the latest release for now, but as soon as that calms down I'll look into this problem again.

    I must admit that I consider CDN as being less part of the core functionality of (or less vital to) Autoptimize. I use the CDN-options in WP Super Cache (which is the ideal companion to Autoptimize) to offload CSS/JS/images to my CDN.

  7. John Conner
    Member
    Posted 1 year ago #

    Hi futta, the CDN option is somehow weird, it seems working at the very first moment of installation, after a clean catche it stops working at all :(

  8. Raphael Suzuki
    Member
    Posted 1 year ago #

    I must admit that I consider CDN as being less part of the core functionality of (or less vital to) Autoptimize. I use the CDN-options in WP Super Cache (which is the ideal companion to Autoptimize) to offload CSS/JS/images to my CDN.

    I really like the way CDN is implemented in Autoptimize, with independent settings for JS, CSS and images, although it does not support parallelization like Super Cache's CDN.

    I also understand that CDN is a complementary feature, but while I don't always use Super Cache, Autoptimize is a must-have in any WP installation I create.

  9. John Conner
    Member
    Posted 1 year ago #

    while I don't always use Super Cache, Autoptimize is a must-have in any WP installation I create.

    Well, Autoptime features are just working with no special config or server annoy. The thing is there should be a PHP way to keep its CDN always working, I found out that it could be stopped with other WP settings or plugins. Any help is appreciated :)

  10. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    I found out that it could be stopped with other WP settings or plugins.

    That is interesting, can you provide some more info on that?

  11. John Conner
    Member
    Posted 1 year ago #

    can you provide some more info on that?

    I can't surely claim that these situations would happen generally:
    1- updating wp from 3.3 to 3.5.1 or bp from 1.6 to 1.7
    2- installing wp better security intrusion module
    3- changing permission of autoptimize folders from 755 to any (e.g.705)
    4- activating "deflate" with .htaccess
    every one of these cases happened on a different site, they're assumed as independent variables (no other changes), and again I can't admit these are just conflicting with autoptimize CDN. I like the plugin, so I continue installing on my wp sites even if CDN goes out of work.

  12. John Conner
    Member
    Posted 1 year ago #

    Just found out with reseting the plugin installation in sql tables, the CDN works again, both js $ css; tnx everyone :)

  13. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Hurray!

    But for my understanding; "resetting the plugin installation" = removing autoptimize options to go back to default?

  14. blau
    Member
    Posted 1 year ago #

    Slightly offtopic: I use Autoptimize together with WP Super cache and what I like is the ability to offload css+js to a CDN with Autoptimize. I may also add, it works failry well for me.

  15. cp_user
    Member
    Posted 1 year ago #

    Hi,

    Would you care to elaborate more on the:

    Just found out with reseting the plugin installation in sql tables, the CDN works again, both js $ css; tnx everyone :)

    Do you mean re-installing or what?

    Tnx

  16. cp_user
    Member
    Posted 1 year ago #

    The Autoptimize works perfect without using CDN.
    As soon as CDN is used, Autoptimize stops working.
    Thats to bad as CDN is vital for some websites.

    I use the CDN Linker from GitHub.com to connect with my account with SoftLayer. So far the only plugin that works with CDN is the JS & CSS Script Optimizer Plugin (The JS works - but not the CSS).

    So it seams to be hard to find a plugin that optimizes both JS & CSS and have it both working with CDN.

    Hopefully Autoptimize can solve this and make it a highly desired plugin.

    Cheers RK

  17. cp_user
    Member
    Posted 1 year ago #

    To clarify,

    The cdn rewrite appears correctly written in the html code, but when testing it in YSlow, you get the following message:

    This page has 11 external Javascript scripts. Try combining them into one.

    Cheers RK

  18. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Hi RK;
    Are the external JS-files that are mentioned by YSlow located on your own server (blog) and rewritten to the CDN, or are those "true" external files (e.g. Twitter, Facebook, ...)?

    frank

  19. cp_user
    Member
    Posted 1 year ago #

    Hi Frank,

    WordPress Site is hosted on a VPS server with ServInt.
    Our CDN account is set up with SoftLayer using orgin-pull.

    The cPanel the folders are setup as follows:
    wp-content
    wp-includes
    images

    Our CDN Linker setup is: http://cdn.oursite.com

    With Autoptimize I've tried all various conbination to get the JS to work -- like http://www.oursite.com http://cdn.oursite.com and more, with no luck.

    I got the JS & CSS Script Optimizer plugin working 99%, just one error with dynamic tabs.

    Tnx RK

  20. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Afraid getting all JS to work can prove a daunting task sometimes.

    Regarding CDN (which was your original question): when CDN is active and URL's are rewritten (as seen in the HTML), what JS-files are being downloaded (as reported by Yslow)?

  21. cp_user
    Member
    Posted 1 year ago #

    Here is a copy of a page source code. I just noticed that the last link is created like this:

    http://.cdn.oursite.com

    This link appears to be written incorrectly as it contains a dot before cdn. Maybe this is what breaks the code???

    <script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-content/themes/3.3/includes/js/theme-scripts.js?ver=3.3'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.position.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.menu.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js?ver=1.9.2'></script><script type='text/javascript' src='http://cdn.oursite.com/wp-includes/js/jquery/ui/jquery.ui.slider.min.js?ver=1.9.2'></script><script type="text/javascript" src="http://.cdn.oursite.com/wp-content/cache/autoptimize/autoptimize_2ebdf6e48d41a13cbde3d444b423f3d9.php"></script>


    [Please use the code buttons when posting code - as is your code may have been corrupted here]

  22. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Well, that dot indeed troubles me. because of it, the aggregated JS-file does not load and that may indeed very well be the reason you can't get everything working.

    I you run Autoptimize without CDN, are all your links (for CSS, JS, images, ...) on the same domain (oursite.com or blog.oursite.com) or are there already differences between those? Does everything work in that case (autoptimize without CDN)? Specifically, what is the URL for the autoptimize JS file at the end if you have CDN turned off?

  23. cp_user
    Member
    Posted 1 year ago #

    All autoptimize files without CDN are on the same domain.

    In the Head Area I have:

    <link type="text/css" media="all" href="http://www.oursite.com/wp-content/cache/autoptimize/autoptimize_e4bd58a2c7f810619c9a92f061744a92.php" rel="stylesheet" /><title> Categories</title>

    In the Footer I see:

    <script type="text/javascript" src="http://www.oursite.com/wp-content/cache/autoptimize/autoptimize_519e9d7e01160191d6dcfb62369695ed.php"></script>

    So without CDN and checking it with YSlow - it does optimize both JS and CSS with no problems - it creates two files - one in the header and one in the footer area.

    Cheers RK

  24. futtta
    Member
    Plugin Author

    Posted 1 year ago #

    Based on this there is a problem with the URL autoptimize assigns to it's own aggregated JS-files when using CDN. Now to make it really hard; it seems to work for some people and not for others (RK, but also the OP of this support thread).

    I will do some more testing on my test-blog to try to reproduce the problem. If I can do that (reproduce the bug), then I'm pretty sure I'll be able to fix it. But reproducing might prove the hard part (as it does work for me). I'll keep you guys posted on progress.

    In the mean time; I use WP Super Cache's CDN functionality myself, works like a charm ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags