• Resolved sdeal

    (@sdeal)


    Hello,

    Can you give me a solution to this problem? When checking logs, I see a lot of errors with code 404 from this plugin.

    I have a 404 page available that is well done and I do not want to touch it.

    I have found some topics in which you discussed this problem but there is no clear solution how to change the problem affecting only js errors from AO plugin?

    
    Line 7: 66.249.76.139 - - [12/Feb/2019:02:25:13 +0200] "GET /wp-content/cache/autoptimize/js/autoptimize_0ccb58f6646c76f3afa03fae050653c4.js HTTP/1.0" 404 17655 "https://XXXXX.eu/produkt-kategoriya/accessories-for-phones/others-phone-accessories/?view=list" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +https://www.google.com/bot.html) Safari/537.36"
    	Line 17: 66.249.76.141 - - [12/Feb/2019:02:48:57 +0200] "GET /wp-content/cache/autoptimize/js/autoptimize_2d22e99ac0f6e7375b7a701563af0b86.js HTTP/1.0" 404 17644 "https://XXXXX.eu/brand/sdeal-phones/?order=asc&per_page=50" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)"
    	Line 22: 66.249.76.143 - - [12/Feb/2019:03:01:05 +0200] "GET /wp-content/cache/autoptimize/js/autoptimize_80949d11c0074153df1836f72a131420.js HTTP/1.0" 404 17655 "https://XXXXX.eu/produkt-kategoriya/summer-2018/?view=list&order=desc" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +https://www.google.com/bot.html) Safari/537.36"
    	
    

    Thank you in advanced!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    The 404’s are due to google(-bot) using cached versions of the HTML that contain references to Autoptimized files that are no longer there due to the caching having been emptied either manually or automatically (by another plugin or by … Divi ?? ), so the easy “fix” is not clearing AO’s cache too frequently.

    The alternative is sending a “410 Gone” instead by amending the 404.php as described here or tweaking .htaccess as described here.

    But all-in-all; nothing to worry about really ??

    Hope this helps,
    frank

    Thread Starter sdeal

    (@sdeal)

    I understand this, but I use your plugin in combination with wp-rocket. When added or updated any page or plugin etc., it reload/clear its own cache, and in addition, in new versions, it clears the AO as well.

    Also, if I do not clean the AO cache, it fills the size according to your plugin:
    Size: 91.15 MB .. and more to 100%
    And at a given moment if it gets 100% it must be cleared. Which again brings us back to the starting position.

    Please correct me if I’m wrong?

    ———-

    Regarding the two solutions, I would like to do them, but how to make them only for the .js files from the AO Puggin.

    I don’t want to remove my current 404 page because it is part of the theme and it’s done well.

    Can you tell me/help me, for one of the two solutions, how do I do it?

    Let’s say “.htaccess”?:

    
    #Response 410 code for the files not exists:
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.autoptimize_*.js)$ - [L,R=410]
    
    # And then to create setting a custom 410 error page like this and build the file with name 410.html with some code inside it:
    
    ErrorDocument 410 /410.html
    

    —————————————————————————————
    If you want I could apply my 404.php code here!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmmm … not my specialty, but you could try adding

    #Response 410 code for the files not exists:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.autoptimize_*.js)$ - [L,R=410]

    to wp-content/cache/.htaccess (assuming you’re on Apache)?

    Thread Starter sdeal

    (@sdeal)

    Yes on Apache server.
    Why to add that into wp-content/cache/.htaccess ? I think it should add to the main .htaccess file on wordpress or not?

    Thank you in advanced.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    if you add it to wp-content/cache/.htaccess then it only applies to files inside wp-content/cache, which is where AO lives. if you do it 2 levels higher, it applies to all 404’s, which you don’t want?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘/autoptimize/js/autoptimize_xxxxxxxx.js 404 error’ is closed to new replies.