0

Im trying to user Varnish between my php application and MySQLCluster to cache the Mysql query responses.

I tried just setting up the Varnish server so that when domain.com gets called the call is redirected to the MySQL Client, the problem is that then the PHP connect code stops working. I tried connecting via IP and via domain and both situations doesnt work.

So what im wondering is Is it possible to do what i want?

If yes how do i do it?

My goal here is to maximise the reliance on caching and reduce load on DB.

Thanks for the help.

Bruno
  • 11
  • 2

2 Answers2

0

MySql has it's own cache, so you would want to start optimizing there first. Varnish is a HTTP cache server, so you can't use it directly with MySql if that's what you were trying to do.

You would want to cache the PHP-rendered HTML with Varnish at the HTTP request level, not at the application level.

ldg
  • 9,112
  • 2
  • 29
  • 44
0

I can recommend Memcached that is good too, but you need to install it both on server and in php scripts, but the speed is good.

luky
  • 2,263
  • 3
  • 22
  • 40