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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > Content-Aware Caching

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2010, 10:48 AM
J.T. J.T. is offline
Member
 
Join Date: Apr 2010
Posts: 34
Default Content-Aware Caching

Hi,

I'm looking at options to save cached versions of otherwise dynamically created pages, but only to those requests that make sense.

It's for an online shop so once a product is added to the basket for example, we need to stop caching. We also show "recently viewed products" in a sidebar, so once stuff like that is populated, we need to switch back to dynamic.

In other words, for search engine crawlers and first time visitors, I want blazing fast load times. Subsequent page loads can be dynamic.

LSWS's caching seems limited by headers and not aware of the contents of the request. It's nice to say don't cache if a cookie is involved, but better would be if the cookie contains "cache=0". Like varnish for example, it would be great if it could look inside the content, be content-aware.

Same with query string matching. We can say don't cache if there's a query string. Better would be if we can say don't cache if there's a query string saying cache=0. It would make LSWS caching a lot more flexible and powerful.

The e-commerce engine creates a cookie on the first load and almost all pages use query strings. I don't have enough clever data to match caching policies against.

Session based policies would be great too.

Is this on the roadmap already?
Reply With Quote
  #2  
Old 07-29-2010, 12:00 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 6,643
You can make caching more flexible like you described with Rewrite Rules by setting environment "Cache-ctrl", like

RewriteCond ${QUERY_STRING} cache=0
RewriteRule .* - [E=Cache-control:no-cache]

You can use regular Cache-Control directives.
Reply With Quote
  #3  
Old 07-30-2010, 03:42 AM
J.T. J.T. is offline
Member
 
Join Date: Apr 2010
Posts: 34
But that controls the browser cache, doesn't it?

I mean serving a static HTML copy of otherwise dynamic content, so we save opcoding and DB querying those pages before sending the HTML to the browser. Like Squid/Varnish or reverse proxies etc. I believe Litespeed Load Balancer offers it too if I read the feature list correctly.

For a first time visitor, even if I set the cache-control headers, then it still only comes into effect on the second page load. I want it so that Litespeed serves a static copy to those.

Basically, I want this but without Varnish, and with LSWS:

http://www.kalenyuk.com.ua/magento-p...-cache-47.html

Based on the user's history/actions, it knows when to set cookies/headers/query strings telling Varnish to show from cache or not to show from cache.
Reply With Quote
  #4  
Old 07-30-2010, 05:50 AM
meto meto is offline
Member
 
Join Date: Jan 2008
Posts: 35
Maybe memcached + lsws + integration in APP
Reply With Quote
  #5  
Old 07-30-2010, 11:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 6,643
Quote:
But that controls the browser cache, doesn't it?
No, it control the server cache behavior.

You can configure LSWS to use cached page by default, and turn off cache with rewrite rule when a page should not be cached.

Maybe it is not exactly what you want, I think we probably need to add a special "Cache-control" directive to tell LSWS when to update a cached page with new content.
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 06:48 AM.



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