• Resolved rurban23

    (@rurban23)


    Hello, I recently noticed a strange increase in image wait times (here) about as long or longer than the wait time for the initial page response itself.

    In Critical CSS – I noticed some strange behavior – critical CSS is being generated for not just pages, but also several files and images too. Examples:

    /about/wp-includes/fonts/css.php
    /about/wp-includes/css/css.php
    /wp-content/uploads/Electricity-Prices-Canada.jpg%E2%80%A6	
    /wp-content/uploads/2019/01/Energyhub.org-Logo-Front-%E2%80%A6
    /wp-content/uploads/Geothermal-Power-Map-Canada.j%E2%80%A6
    /wp-content/uploads/Clean-Energy-Financing-Progra%E2%80%A6

    I haven’t confirmed this, but I suspect the two might be related?

    Thanks,

    Rylan

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter rurban23

    (@rurban23)

    Note, the critical CSS generated for these files/images are more or less the same as what’s being generated for any given page.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s … novel Rylan. It implies that all your files are delivered through WordPress’ PHP code which is not something usually done and it does explain the longer wait time. I think you’ll have to review the .htaccess (assuming you’re using a webserver that uses that file) to ensure static files are not served by WordPress but directly from filesystem by the webserver?

    Thread Starter rurban23

    (@rurban23)

    So, Siteground has an option called “Ultrafast PHP” – and I have confirmed that the functionality is as you explain – files are delivered through PHP code. If this is not best practice, and conflicts with CriticalCSS, then I will disable.

    Thread Starter rurban23

    (@rurban23)

    I also removed all rules… let’s see what happens this time around. My htaccess file is super simple btw. Just the WP default plus a redirect to www

    Thread Starter rurban23

    (@rurban23)

    Alright, as noted, I:
    – Changed PHP to standard, version 7.4
    – Cleared all caches
    – Deleted all CriticalCSS rules and jobs
    – Re-ran.

    Still getting a few images come through:
    /wp-content/uploads/Clean-Energy-Targets-Canada-1%E2%80%A6

    And noticed this in my job queue:
    /wp-content/cache/autoptimize/css/autoptimize_single_5cbff7eb69fb8a1afaf96ca2d23e76da.css

    Any idea what to make of this? Or how to stop it?

    Here’s my htaccess fyi:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^energyhub.org [NC]
    RewriteRule ^(.*)$ https://www.energyhub.org/$1 [L,R=301]
    AddHandler application/x-httpd-php74 .php .php5 .php4 .php3

    Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmm, those are 404’s which apparently aren’t recognized as such, as AOCCSS excludes if is_404(). might be your theme (or a plugin) is changing the 404 handling behavior, resulting those pages in getting into AOCCSS’s queue .. :-/

    Thread Starter rurban23

    (@rurban23)

    I got it figured out. It’s a conflict with this popular plugin: https://www.ads-software.com/plugins/404page/ which I’ve disabled for now.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmm, maybe ask that plugin’s developer if there’s a way the plugin can be configured to keep is_404() returning true on those custom 404 pages?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Critical CSS on .php .css .jpg .img files’ is closed to new replies.