LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   LiteSpeed Cache (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=30)
-   -   Wrong cache hit (http://www.litespeedtech.com/support/forum/showthread.php?t=5048)

IrPr 06-09-2011 05:21 PM

Wrong cache hit
 
Hi there,
I'm seeing a very unexpected and unknown act by Litespeed cache feature

Here is my cache Policy config:
Code:

  <cache>
    <storage>
      <cacheStorePath>/dev/shm/lswscache</cacheStorePath>
      <maxCacheObjSize>102400</maxCacheObjSize>
    </storage>
    <cachePolicy>
      <enableCache>0</enableCache>
      <expireInSeconds></expireInSeconds>
      <qsCache>1</qsCache>
      <reqCookieCache>1</reqCookieCache>
      <respCookieCache>1</respCookieCache>
      <ignoreReqCacheCtrl>1</ignoreReqCacheCtrl>
      <ignoreRespCacheCtrl>1</ignoreRespCacheCtrl>
    </cachePolicy>
  </cache>

here is my full htaccess with cache-control rewrite rule:
Code:

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(jpg|gif|jpeg|png|css|ico|js|swf|zip|rar|mp3|exe) [NC]
RewriteRule . /index.php [L,E=Cache-Control:max-age=900]
</IfModule>

This is a big wordpress which I've enabled cache for its contents
They're using SEO plugin and urls are in this format:

/year/month/day/title/

While most of links are cached and fetched properly sometimes a few urls are fetching wrong content instead
for example /2011/06/09/title1 returns the content of another post, /2011/06/09/title2

It returns wrong content for all requests for that url till pruning cache dir while the other cached contents are working properly

I'm using Cache feature on many servers with the same rules for WP, all of them are working like a charm but this one

Please note that its not occurring for WP only, there are other CMS such as PHPNuke which the same issue is happening with SEO rewrited urls, and the most unexpected thing is that they're fetching the contents from each other websites!
The only matching thing between these URLs is that they're non-existing files SEO rewrite rules, but not the same cond/rules

Seems there is a problem while saving the item to the cache to me

PS: All 4.1x versions are affected

Any idea is welcome

Thanks

mistwang 06-13-2011 03:34 PM

does it happen randomly? or persistently?
can it be reliably reproduced, like when it happened, /2011/06/09/title1 always return content of returns the content of /2011/06/09/title2? or, next time, just change to something else?

We need to somehow reproduce it in our lab in order to get it fixed.

IrPr 06-28-2011 09:36 AM

Dear George,

Its happening very rarely and random, but when it occurs for one of cached contents it returns another cached object (just the same, not jumpy) until pruning cache directory

I've experienced this issue on another busy server with big sites and lots of cached contents and very high hit rate

Indeed its happening for the sites with the highest cached content and hit rate
The CMS is not similar, the only resemblance is both websites are under heavy cache hit

It seems to my customers that server/website is hacked, however it occurs very rarely

Please let me know if any further information is needed

mistwang 06-28-2011 07:25 PM

I think it might be due to hash collisions. We will add more code to handle this situation.
And we will improve the hash function for the page cache indexes to reduce collisions, will let you know when it is ready.

mistwang 06-29-2011 01:44 PM

Please download and try 4.1.2 build, just change version number in the download link to get it.

IrPr 07-05-2011 01:02 PM

Quote:

Originally Posted by mistwang (Post 27437)
Please download and try 4.1.2 build, just change version number in the download link to get it.

I've just installed 4.1.2 and see
but now directory listing is broken even with Options Indexes in htaccess and httpd.conf

would you please take a look into this also?

mistwang 07-05-2011 01:07 PM

Please check error.log and stderr.log. no change has been made related to directory listing in 4.1.2 .

IrPr 07-05-2011 01:15 PM

Here is the problem

2011-07-06 00:41:49.812 [INFO] [x.x.x.x.56857-0#APVH_w00t.com] Found symbolic link, or owner of symbolic link and link target does not match for path [/opt/lsws/share/autoindex/default.php], access denied.

symlink is disabled through LSWS admin console and its impossible to turning that on due to security reasons which you know well

mistwang 07-05-2011 01:29 PM

Maybe you can use "If Owner match" instead of disable symlink completely.

mistwang 07-05-2011 03:03 PM

download 4.1.2 again, this version may work well with symlink off.


All times are GMT -7. The time now is 05:42 PM.