Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter gpeipman

    (@gpeipman)

    CDN Enabler plugin doesn’t seem to affect anything. What made things work was leaving CDN URL empty in Autoptimize settings.

    I think that the problem may happen with this code block in add_lazyload_js_footer() function:

    $lazysizes_js = plugins_url( ‘external/js/lazysizes.min.js?ao_version=’ . AUTOPTIMIZE_PLUGIN_VERSION, __FILE__ );
    $cdn_url = $this->get_cdn_url();
    if ( ! empty( $cdn_url ) ) {
    $lazysizes_js = str_replace( AUTOPTIMIZE_WP_SITE_URL, $cdn_url, $lazysizes_js );
    }

    No matter what it noptimize attribute is set or not there will be CDN URL if provided. Changing this if to:

    if ( ! empty( $cdn_url ) && $noptimize_flag != ”)

    made things work. And it doesn’t matter if CDN Enabler is active or not.

    Thread Starter gpeipman

    (@gpeipman)

    I don’t have any script exclusions defined. But I have another CDN plugin in use. I will check if this is the case and come back to you later. Thanks for advice!

    Thread Starter gpeipman

    (@gpeipman)

    For testing purposes I have back-door access to my WordPress VM-s and there caching doesn’t apply. I saw that data-noptimize=”1″ attribute is added or left out based on if I had this filter added or not. But it was the only thing that changed. Script reference to //static.gunnarpeipman.com//wp-content/plugins/autoptimize/classes/external/js/lazysizes.min.js?ao_version=2.7.1 was always printed out to footer of page.

    Thread Starter gpeipman

    (@gpeipman)

    Hi,

    it doesn’t seem to work.

    Still I see the following script reference in the footer of my page:

    <script async=”” data-noptimize=”1″ src=”//static.gunnarpeipman.com//wp-content/plugins/autoptimize/classes/external/js/lazysizes.min.js?ao_version=2.7.1″></script>

    My question was about getting rid of this script reference and having lazysizes.min.js embedded to JavaScript file that Autoptimize combines of JavaScripts referenced on page.

    I have currently version 2.7.1 installed.

    Thread Starter gpeipman

    (@gpeipman)

    Hi!

    Thanks a million for this feature as it greatly improves page speed statistics.

    I made my tests on this update and it’s now live in my blog https://gunnarpeipman.com. I confirm there’s no conflicts with other plugins and plugins order doesn’t matter anymore. CDN enabler, Autoptimize and WP Super Cache can now live their own lives and WebP Express works no matter what.

    Great job, guys! And thanks again!

    Thread Starter gpeipman

    (@gpeipman)

    I agree, this topic can be closed.

    About WP Super Cache – I try to solve this issue by making it using some other directory so it doesn’t wipe off things it shouldn’t touch.

    Thanks for helping me!

    Thread Starter gpeipman

    (@gpeipman)

    Hi,

    I can confirm it works stable now. Styles and scripts live on mounted Azure File Shares and there’s no issues when files are served directly from WordPress. I think this solution can be confirmed as working.

    My next experiment will be with Azure Blob Storage (some higher tier) so Autoptimize files can be automatically picked up by CDN.

    One things I noticed – files from Autoptimize folders are deleted when cleaning WP Super Cache caches. Not sure what it is exactly doing or why but there’s a correlation. Everytime I clean WP Super Cache caches the number of Autoptimize files drops. Again, I don’t know yet why it happens.

    Thread Starter gpeipman

    (@gpeipman)

    It’s a little bit weird. During ~2h after moving to file shares the number of scripts and styles changed. 24 files and then 14 files etc. But it stabilized over day. I checked plugins and themes – none of these calls clearall(). I’m not yet sure what actually made files disappear.

    Thread Starter gpeipman

    (@gpeipman)

    It seems to work now with Azure File Shares. Files are written there and everything seems to work. I started new mobile friendliness validations on Google Search Console and I will wait until these are done by Google.

    Meanwhile one question. Although files are written to file share I saw the number of CSS files growing and decreasing. First attempts to start validation in search console gave me immediate result that some pages are invalid. During requests by Google files were generated and some of them later disappeared magically. What causes this behavior? Is it possible to leave once generated scripts to disk for let’s say two days to make sure that all clients have already invalidated these?

    Thread Starter gpeipman

    (@gpeipman)

    Sticky load-balancing and other more advanced ones come on Azure with way higher price tag. Additionally these options doesn’t distribute load well as requests to one VM are not distributed to others.

    What are the options for me with basic load-balancing? Should I make Autoptimize cache folder to symlink that points to shared storage? Or is there some script variable I can modify?

    Thread Starter gpeipman

    (@gpeipman)

    Thanks for explanation, everything works now!

    Br,
    Gunnar

    Thread Starter gpeipman

    (@gpeipman)

    In total there can be three types of full URL-s to consider:

    1. Site url from WordPress settings
    2. Alternate URL for specific machine in farm (one for every machine)
    3. CDN URL

    1. and 2. are usually insterted by humans. Yes, they can sometimes use machine URL although it’s not allowed. It just happens. 3. is by random CDN plugin.

    Thread Starter gpeipman

    (@gpeipman)

    Hi!

    Yes, sure, I can share. Here we go:

    Old structure: https://gunnarpeipman.com/2018/05/sample-post/
    New structure: https://gunnarpeipman.com/category-name/sample-post/

    By example: https://gunnarpeipman.com/aspnet/blazor-pager-component/

    I’m not 100% sure if this is the issue with vanilla installation of things. I have also some SEO plug-ins installed but these doesn’t seem to involve to redirects.

    Thread Starter gpeipman

    (@gpeipman)

    Hi!

    In my plugin I make some HTML clean-up (I have posts ported from previous blog) to remove or work around some legacy HTML stuff the way that problems doesn’t come up with AMP plugin. There were problems that I was able to solve with plugin within few hours but doing same thing on very general manner would be huge load of work for you as you have to support big number of users.

    There is also one series plugin that generates series menu to some posts like here: https://gunnarpeipman.com/2018/01/ref-returns-ref-locals/amp/ Without my plugin links in post body get /amp/ to the end but not entries in series table of contents.

    I also added categories list in WordPress menu manager to AMP menu and these also didn’t got /amp/ added to end of URL-s there. So, I tried to manage it with my plugin but then suddnely some links got /amp/amp/ to the end. I found out that I should check if link callback is done for categories list in body or for categories menu but I didn’t found any normal way for this.

    NB! Turning on AMP for menus made a trick! Thanks ??

    • This reply was modified 7 years, 1 month ago by gpeipman.
    Thread Starter gpeipman

    (@gpeipman)

    Hi!
    If I try to analyze things on practical side then I don’t think mobile readers are interested in trackbacks. Trackbacks often doesn’t provide enough information to attract readers to follow their links. So, I think correcting the number of comments is better option.

Viewing 15 replies - 1 through 15 (of 16 total)