"Apache Directives" for a Site

Discussion in 'General' started by orasis, Oct 29, 2014.

  1. orasis

    orasis Member

    As I was testing a big .htaccess file for a site I noticed that it slowed down the site performance. So I moved those directives to the "Apache Directives" textarea of the site in IPSConfig 3 hoping that apache would cache it and read it only once. Unfortunately the site is same slow as if apache is reading those directives on every page load.

    Are the Apache Directives in ISPConfig 3 being read on every page load ?
    Is there any way around this except writing a custom php script ? Is something wrong with my setup ?

    This is ISPConfig 3 on debian wheezy x64.

    Thanks !
    George
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No, they are loaded once on apache start.

    The most likely reason for the slowdown is not the size of the .htaccess file. A rewrite rule in apache is a regular expression which gets matched against the request header, so if you have many rules, then apache ahs to match each of them one after another against the request and this may slow down your server.
     
  3. orasis

    orasis Member

    I had a php script for redirects on that site that was using database entries for that and I thought to make things faster by using apache directives directly. The opposite happened !

    Is php faster than apache in that matter ? wow this is strange :)
     

Share This Page