• Resolved timholz

    (@timholz)


    Hi
    When i enable AI i get ?Specify a cache validator? for all the jpg’s that the plugin generates. When i disable the plugin i do not get this recommendation (tested on: google pageSpeed, gtmetrix).
    Is there a way to fix this in the code that the plugin injects into .htaccess? For your information: i have w3 Total cache installed.
    Thanks a lot for your interest.
    regards
    theo

    https://www.ads-software.com/plugins/adaptive-images/

Viewing 12 replies - 16 through 27 (of 27 total)
  • Plugin Author Takis Bouyouris

    (@nevma)

    Hi, there!

    I tested https://www.creatifpassion.ch/ with Gtmetrix and indeed it works. So, if you agree too, I will add this to the new version. Thanks for helping me in debugging…

    ??

    Thread Starter timholz

    (@timholz)

    Hi Nevma
    Thanks for the message.
    No, problem, it is anyway your intelligence at work.
    But to be absolutely sure, i suggest to run more tests.
    I am not sure whether the presence of other plugins like w3 Total Cache,
    WP Super Cache or Autoptimize have an impact.
    It can be quite tricky.

    all the best to you
    theo

    Plugin Author Takis Bouyouris

    (@nevma)

    Thanks for the tip, I will do that too!

    Thread Starter timholz

    (@timholz)

    Hi Nevma
    My observation is, that autoptimize plug is causing the main problem.
    The plug in has three sections: html, scripts, css.
    When deactivating the script section the your plugin works fine.
    I don’t think that W3 Total cache and WP Supercache interfere in any way.

    good luck with further tests
    theo

    hiya there;
    I’m AO’s developer. If AI relies on JS to have the browser download the correct image-file, then one indeed might need to exclude that JS (and dependancies) from being aggregated/ minified in AO’s settings page.

    Hope this helps,
    frank

    Thread Starter timholz

    (@timholz)

    Hi Frank
    Thanks for watching and the message.
    The problem is, that it’s not a specific JS but rather a php (if am not wrong: ai-cookie.php) that generates the cookie. I don’t find any other js file in the plugin.
    But anyway thanks for your tip. Maybe Nevma has an idea.

    regards
    theo

    there is, in adaptive-images-front.php;

    <script type = "text/javascript">
         document.cookie = 'resolution=' + Math.max( screen.width, screen.height ) + '; path=/';
    </script>

    try adding “resolution=” (without the quotes) to the comma-seperated JS exclusion file.

    frank

    Thread Starter timholz

    (@timholz)

    Did it. Works fine.
    Thank you Frank.
    theo

    Plugin Author Takis Bouyouris

    (@nevma)

    Hey, guys,

    Indeed the AI plugin depends on that tiny bit of Javascript which only needs to run once to set the cookie. And it added to the HEAD of the theme via the PHP file you mentioned. I was not aware of the fact that the Autoptimize plugin might need to take something into account in order for this to work.

    I will check it out and see if I can work around it!

    Plugin Author Takis Bouyouris

    (@nevma)

    Frank, was the problem cause by the single quotes?

    no, reason was that (for now by default) AO aggregates & minifies all JS, both inline & in local referenced JS-files and added late in the HTML. in this case there might have been some other JS-file breaking due to the aggregation, which leads to all other JS in the optimized JS-file to be aborted.

    working around this can be as simple as wrapping the inline JS in noptimize-tags, like this;

    <!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->

    that way users of both our plugins don’t have to do a thing; AO will leave noptimized code as is.

    kind regards,
    frank

    Plugin Author Takis Bouyouris

    (@nevma)

    Will do that, thanks, Frank!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Specify a cache validator’ is closed to new replies.