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)
-   -   LiteSpeed Cache + PhpFox (http://www.litespeedtech.com/support/forum/showthread.php?t=6504)

LowKey 12-27-2012 07:10 AM

LiteSpeed Cache + PhpFox
 
Hello,

Successful enable LiteSpeed Cache, but i'm having one problem with the phpfox website.

After i'm added RewriteRule cache .htacesss

RewriteRule (.*\.php)?$ - [L,E=Cache-Control:max-age=120]

The server seems very fast and cache is working, but one problem is the session user changed to another user. Which mean i'm as administrator/admin change to another user. (Session ID changing)
I'm don't know, why this happen?

I'm disable cache by commented out # on .htaccess.

It's back to normal,but no cache apply from LiteSpeed.

Hope LiteSpeed Staff can look at my issue.

Here my cache setting on LiteSpeed

Storage Path /dev/shm/lsdiskcache
Max Object Size Not Set

Enable Cache No
Cache Expire Time (seconds) Not Set
Cache Request with Query String Yes
Cache Request with Cookie Yes
Cache Response with Cookie Yes
Ignore Request Cache-Control Yes
Ignore Response Cache-Control Yes
Enable Private Cache No
Private Cache Expire Time (seconds) 120

Note : I'm applying LiteSpeed with PHPFox.

Thanks.

mistwang 12-27-2012 10:51 AM

You can only use private cache for login user, public cache for guest visitors.
Please read more about our wikis.

imohsen 12-27-2012 01:29 PM

Quote:

Originally Posted by LowKey (Post 41492)
Hello,

Successful enable LiteSpeed Cache, but i'm having one problem with the phpfox website.

After i'm added RewriteRule cache .htacesss

RewriteRule (.*\.php)?$ - [L,E=Cache-Control:max-age=120]

The server seems very fast and cache is working, but one problem is the session user changed to another user. Which mean i'm as administrator/admin change to another user. (Session ID changing)
I'm don't know, why this happen?

I'm disable cache by commented out # on .htaccess.

It's back to normal,but no cache apply from LiteSpeed.

Hope LiteSpeed Staff can look at my issue.

Here my cache setting on LiteSpeed

Storage Path /dev/shm/lsdiskcache
Max Object Size Not Set

Enable Cache No
Cache Expire Time (seconds) Not Set
Cache Request with Query String Yes
Cache Request with Cookie Yes
Cache Response with Cookie Yes
Ignore Request Cache-Control Yes
Ignore Response Cache-Control Yes
Enable Private Cache No
Private Cache Expire Time (seconds) 120

Note : I'm applying LiteSpeed with PHPFox.

Thanks.


in some of softwares that based on cookies this options may cause some weired problems .
so set it to no and take a shot !

Quote:

Cache Request with Cookie Yes
Cache Response with Cookie Yes

LowKey 12-27-2012 03:30 PM

Quote:

Originally Posted by imohsen (Post 41517)
in some of softwares that based on cookies this options may cause some weired problems .
so set it to no and take a shot !

I'm follow the setting,

but getting error :

404 Not Found
The resource requested could not be found on this server!

Can't open the website. Please help :)


Thanks.

NiteWave 12-27-2012 05:08 PM

to enable public cache for guest visitors, please refer to vBulletin cache setting:
http://blog.litespeedtech.com/2011/0...uilt-in-cache/
and / or
http://www.litespeedtech.com/support...ache:vbulletin

all other php scripts should have similar settings to enable public cache for guest visitors.

LowKey 12-27-2012 06:03 PM

Hello,

Seems i'm successful apply cache,

I'm put this on .htaccess

RewriteEngine On

## cache should be available for HEAD or GET requests

 RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
## select which pages to cache
RewriteCond %{HTTP_COOKIE} page_contain_cachetoken=yes
# with other condition

 RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32}

 # excluding certain URLs
RewriteCond %{REQUEST_URI} !/(login|register|usercp|private|profile|cron|image) \.php$

# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$ – [L,E=Cache-Control:max-age=120]

and the website running, without any error dumped on error_log.

However this is public cache right ? I have question how to check whether this is already cached by LiteSpeed Cache or I'm also using CloudFlare .

I'm need guide how to make private cache also.

#Update1

VH Name Req in Processing Req/Sec Total Req Total Cache Hits Cache Hits/Sec Output Bandwidth ExtApp Processes EAProc In Use EAProc Idle EAProc WaitQ EAProc Req/Sec
APVH_xxx.net 110 118.4 31,136 0 0.0 0 2 10 0 100 109

Total Cache Hits : 0 <-- still not working.

Thanks.

NiteWave 12-27-2012 06:58 PM

Quote:

I have question how to check whether this is already cached by LiteSpeed Cache
please refer:
http://blog.litespeedtech.com/2011/0...uilt-in-cache/
Quote:

7. Verify if pages are served from the cache

Since 4.0.19, LiteSpeed will output a response header 'X-LiteSpeed-Cache hit' if the content is served from its internal cache.
can check the header in firebug.

Quote:

Total Cache Hits : 0 <-- still not working.
you're right. this number tell you the cache hits number.

LowKey 12-27-2012 07:04 PM

Hello,

Unfortunately, i can't see any response header response header “X-LiteSpeed-Cache hit”

I'm using FireBug to check the header.

webizen 12-28-2012 06:19 PM

[QUOTE=LowKey;41549]...
# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$

webizen 12-28-2012 06:20 PM

Quote:

Originally Posted by LowKey (Post 41549)
...
# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$ – [L,E=Cache-Control:max-age=120]
...

Try:

RewriteRule (.*\.php)?$ – [L,E=Cache-Control:max-age=120]
# leading "/" should be removed in .htaccess


All times are GMT -7. The time now is 02:46 AM.