LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > LiteSpeed Cache > LiteSpeed Cache + PhpFox

Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2012, 07:10 AM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Default 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.

Last edited by LowKey; 12-27-2012 at 08:22 AM..
Reply With Quote
  #2  
Old 12-27-2012, 10:51 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You can only use private cache for login user, public cache for guest visitors.
Please read more about our wikis.
Reply With Quote
  #3  
Old 12-27-2012, 01:29 PM
imohsen imohsen is offline
New Member
 
Join Date: Dec 2012
Posts: 9
Quote:
Originally Posted by LowKey View Post
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
Reply With Quote
  #4  
Old 12-27-2012, 03:30 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Quote:
Originally Posted by imohsen View Post
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.
Reply With Quote
  #5  
Old 12-27-2012, 05:08 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
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.
Reply With Quote
  #6  
Old 12-27-2012, 06:03 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
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.

Last edited by LowKey; 12-27-2012 at 06:23 PM..
Reply With Quote
  #7  
Old 12-27-2012, 06:58 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
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.

Last edited by NiteWave; 12-27-2012 at 09:05 PM..
Reply With Quote
  #8  
Old 12-27-2012, 07:04 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Hello,

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

I'm using FireBug to check the header.
Reply With Quote
  #9  
Old 12-28-2012, 06:19 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
[QUOTE=LowKey;41549]...
# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$
Reply With Quote
  #10  
Old 12-28-2012, 06:20 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
Quote:
Originally Posted by LowKey View Post
...
# 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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:35 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.