Page 1 of 1

caching with varnish reverse proxy [solved]

Posted: Fri Sep 26, 2014 9:45 am
by HarmO
I'm looking to transfer my websites to gandi.net hosting.
this hosting uses a reverse proxy called Varnish to cache content and thus speed up the website. I have already some WP sites set up and using a plugin, the results are blazing fast websites !

But there is a problem with CMSMS. I asked gandi.net, but Varnish cache does not work if you use cookies and as you may know, CMSMS uses a session cookie.

My questions:
  • Is there a way to disable the session cookie?
  • How do i control the "cache control" header of a web page with CMSMS? do i just add it in the htaccess?

Re: caching with varnish reverse proxy

Posted: Fri Sep 26, 2014 7:34 pm
by JohnnyB
Is there a way to disable the session cookie?
- no probably not without modifying the file that sends the cookie. -- and that is not recommended.

How do i control the "cache control" header of a web page with CMSMS? do i just add it in the htaccess?
-- there are server settings that can be set to do this in server config files and or in .htaccess - ask your host.
But, I believe, any cache control written into a local file script may be able to override server settings...

I would disable Varnish in your case and then try something like CloudFlare.com instead which will provide some similar benefits without the restrictions.

Re: caching with varnish reverse proxy

Posted: Mon Sep 29, 2014 3:24 pm
by HarmO
I was going to use a CDN, but there is a mayor difference between a CDN and (serverside) Caching. I see that the proposed cloudflaire has some kind of caching service too, but the big question will be if it works for the webpages with the session cookie that CMSMS creates?

If you have some 100 pages of which only a few change regularly, why should my website do DB connections for those pages that don't change? The HTML output can be generated and then cached. of course the cache has to be removed if you update the webpage.

Since i already have my hosting account, and i want to make use of the varnish caching that is included in my account, is there no global setting, line of code for the config.php file or template-tag that allows us to disable the session cookie?

Re: caching with varnish reverse proxy

Posted: Mon Sep 29, 2014 4:11 pm
by JohnnyB
" but the big question will be if it works for the webpages with the session cookie that CMSMS creates"
--Yes, I have several CMSMS sites running through cloudflare.com

For your other question, I don't think so, since the nature of CMSMS is to be dynamic and update information (things like calendar events, news articles that are set to publish at a later date, etc) as needed. A CMSMS core developer would need to answer.

Re: caching with varnish reverse proxy

Posted: Mon Sep 29, 2014 5:39 pm
by calguy1000
There is no possible way at this moment to disable the session cookie.
Removing the session cookie (even for the frontend) could have negative effects on many modules.

Re: caching with varnish reverse proxy

Posted: Mon Oct 20, 2014 8:52 am
by HarmO
Ok
good to know,

i chose other hosting for the CMSMS projects ...