• I use an additional image folder in my root dir below /wp-content fex.
    /image/headerlogo.png
    while running a speed check it seems that images called within the template header from /image loading slower …
    could it be that image loading is much slower from outside /wp-content/uploads or it does not matter?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator James Huff

    (@macmanx)

    Are you using Jetpack’s Photon module, or another image CDN plugin?

    Thread Starter cluster666

    (@cluster666)

    thanks for reply, I’m using the autoptimize plugin without CDN …
    Multisite w/ 4 languages … sometimes it seems that WP is searching for images in uploads first …

    Moderator James Huff

    (@macmanx)

    If you deactivate autoptimize, does that resolve the situation?

    Hi guys;
    Autoptimize does not do anything to images, so that would not really make sense (I’m the developer ?? ).

    Now as far as “wordpress looking for images” is concerned, per the default .htaccess;

    # 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
    </IfModule>

    and specifically the !-f line, requests for existing files (including images) are not handled by WordPress, but by your webserver (Apache, probably). Can you check if this is in your .htaccess as well (and that .htaccess does not contain any “funky” stuff for images)?

    Next up I would check the image size of the images that seem to be slower. How big is it (are they), can you optimize them with https://optimizely.com/ (great tool)?

    Last remark: in my experience it is not abnormal to see Apache serving a file slower on occasions, but it would be “on occasion” and it Would not always be the exact same file.

    Conclusion:

    could it be that image loading is much slower from outside /wp-content/uploads or it does not matter?

    No, it will very probably not matter ??

    Hope this helps,
    frank

    Thread Starter cluster666

    (@cluster666)

    Hi James, now I have disabled all installed plugins in network settings and re-enabled each per site … the browser lang redirect was enabled to all network sites – seems page load is a little faster
    Pagespeed results shows images bellow 0.8 but it shows admin-ajax.php w/ about 1.5 – 2s, I’m using kk Star Ratings which call admin-ajax.php
    var bhittani_plugin_kksr_js = {"nonce":"d56ebe22d3","grs":true,"ajaxurl":"https:\/\/www.mydomain.tld\/wp-admin\/admin-ajax.php","func":"kksr_ajax"
    <script type="application/ld+json">{ "@context": "https://schema.org", "@type": "WebSite", "url": ...

    Thread Starter cluster666

    (@cluster666)

    thank you guys, should I change something here?

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Thread Starter cluster666

    (@cluster666)

    wp-admin has been protected w/ htaccess so there is a additional rule inside htaccess:

    <Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any
    </Files>

    Thread Starter cluster666

    (@cluster666)

    I guess there is something wrong by calling

    https://www.mydomain.tld/en/wp-admin/admin-ajax.php

    this is a multisite and base dir is /
    so it should not call /en/ or /fr/ parts in the URL
    could this be the reason?

    you .htaccess is (almost) identical to my multi-site test-installation, so I see no problems there.

    the language-thing

    (almost, as this is also in mine:

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    but that only affects requests like /site1/files/abc.xyz)

    admin-ajax.php in general will be slow(er), as it is code being executed upon every page load. don’t think you have to worry about the language identifier though.

    frank

    Moderator James Huff

    (@macmanx)

    this is a multisite

    I’ll move this over to the Multisite forum.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    wp-admin has been protected w/ htaccess so there is a additional rule inside htaccess:

    REMOVE THAT.

    You’re blocking ADMIN-AJAX. It’s in there.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘images outside uploads folder slowing down?’ is closed to new replies.