• Resolved Grubyy

    (@grubyy)


    Hello,

    I have been using the LS Cache server for several months, currently v2.9.8.4. Generally your plugin works very nice, but I found one problem, that could be wasting googlebot crawl budget. If I delete all cache in advanced options or I choose option clear all LS Cache – CSS / JS, deleted, empty files still return the HTTP 200 code. After a few minutes in cache catalog they appear again instead returns the 404 code. The second fact, if I change file name, for example:
    currently: domain.com/min/51573.css
    after: domain.com/min/test.css
    After a few minutes file test.css will apear in cache directory on my server.
    In the server log files you can see that Googlebot visits old files/url adresses from its memory as long as they retun 200 status code.
    There are a two solutions, deleted files should retun 404 code or better, recources should have constant url adress for all the time.

    How can i fix it?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please check the HTTP header on these /min/XXXXX file ?

    In certain case , this file will be served from server cache system , instead of load as static file from /wp-content/cache/css(js)/xxxxx.

    Also could you please try “purge all” and/or “purge LS cache” button and see if this also happens ?

    Best regards,

    Thread Starter Grubyy

    (@grubyy)

    Thanks for a quick reply.

    I checked HTTP headers with a several tools and all of them shows that codes status are 200.
    HTTP / 1.0 200 OK =>
    Content-Type => text / css; charset = utf-8
    Cache-Control => public, max-age = 2592000
    Expires => Sun, 08 Sep 2019 21:06:24 GMT
    Etag => “33676-1565384784 ;;;”
    X-Litespeed-Cache => miss
    Content-Length => 0
    Date => Fri, 09 Aug 2019 21:06:24 GMT
    Server => LiteSpeed
    Alt-Svc => quic = “: 443”; a = 2592000; v = “35,39,43,44”
    Connection => close

    If i check random file name /min/xyz.css its also 200.

    I used “purge all” and / or “purge LS cache” options and after that cache directory on my server was empty for a several minutes. I checked that CSS file in header tag has a new name and after 10 minutes i checked status for previous file – it was still 200. Ten minutes later previous CSS file was apperead, but it’s acctually empty (0KB).

    Edit:
    It’s the same situation with JS files.

    • This reply was modified 6 years, 9 months ago by Grubyy.
    • This reply was modified 6 years, 9 months ago by Grubyy.
    • This reply was modified 6 years, 9 months ago by Grubyy.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes, I see that random /min/xxxxx.css returns 200.

    I will run some test and check.

    Best regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Please edit file /wp-content/plugins/litespeed-cache/inc/optimize.class.php

    add following code before line 201

    			if ( ! $content ) {
    				LiteSpeed_Cache_Log::debug( '[Optm] Static file generation bypassed due to empty' ) ;
    				return ;
    			}

    Then empty file or deleted ones should be 404

    Please let us know how it goes.

    Best regards,

    Thread Starter Grubyy

    (@grubyy)

    Hi,

    I added your code in the file. After that, I changed the file name to a random combination and now they return 404, and it looks like that random files have not been added in cache directory.

    Thanks a lot!

    • This reply was modified 6 years, 9 months ago by Grubyy.
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Deleted CSS files return code 200’ is closed to new replies.