I’m optimizing our webpage, and we have notice something we want to dramatically improve. We use Symfony 1.3.
When the user loads example.com, the filters (rendering, security and remember) are executed. Then we execute our subdomain filter. If it’s the first time the user is here, we get the preferred language of his browser and we redirect the webpage to en.example.com or es.example.com. If the user has a session, we get the language from its session; and we redirect to the subdomain. Then the en.example.com page loads again.
We lose around 1.5 seconds on that redirect. The en.example.com loads sometimes faster than that. How we can get rid of that delay? Changing the index.php and doing the browser-memcache-or-db queries directly without loading symfony?
thanks a lot!
I finally made the redirection on index.php. From 1 to 1.5 seconds to 40ms. Something like: