1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Website Inbuilt Cache Not Enough.

Discussion in 'Apache' started by chetanmadaan, Feb 4, 2013.

  1. #1
    Hi -
    we have a Joomla based website and we are using the inbuilt cache to make the website fast enough for our users... but it really isn't working well... i would say.
    The Joomla Cache is very limited and we were thinking if we can enable a server side cache for apache/php or something like that... which would work above Joomla and make all the contents cacheble.

    Any tips on where shall i start digging?
     
    Solved! View solution.
    chetanmadaan, Feb 4, 2013 IP
  2. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #2
    Mate, dump Joomla and go with Drupal. It's built for stability, performance and security. You can do some highly aggressive caching with it that will put Joomla to absolute shame.

    Otherwise, you can use .htaccess to add expiry for CSS, images, JS, etc, so that browsers won't constantly download them and instead load them from cache. If Joomla doesn't already do it, you could compress the JS and CSS files, too, using .htaccess. Better if you can combine CSS and JS, so you just have two individual files, and also minify them.
     
    ryan_uk, Feb 5, 2013 IP
  3. job_online

    job_online Active Member

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #3
    Agree with ryan_uk + install eaccelerator for php (server "plugin"), ask your hosting provider if it is installed or check php info, clean xhtml code via w3c, clean css code and use above mentioned htaccess caching (expiry, browser leverage etc)
     
    job_online, Feb 5, 2013 IP
    ryan_uk likes this.
  4. chetanmadaan

    chetanmadaan Active Member

    Messages:
    325
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Thanks for your replies mate.... but i can't switch to drupal that's not an option.
    We have already compressed and combined the css/js files.
    I am quiet not sure on how to describe expiry for files in .htaccess.... can someone provide a doc or link to this??

    Thank you so much again.
     
    chetanmadaan, Feb 5, 2013 IP
  5. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #5
    Easiest way is to use FilesMatch, so it doesn't matter what CSS, image or JS files you add later, they will all get an expiry.

    http://httpd.apache.org/docs/2.2/mod/mod_expires.html#expiresactive
    http://httpd.apache.org/docs/2.2/mod/mod_expires.html#expiresdefault
    http://httpd.apache.org/docs/2.2/mod/mod_expires.html#AltSyn
    http://httpd.apache.org/docs/2.2/mod/core.html#filesmatch

    <FilesMatch "\.(gif|jpe?g|png)$">
      ExpiresActive on
      ExpiresDefault "access plus 90 days"
    </FilesMatch>
    Code (markup):
     
    ryan_uk, Feb 5, 2013 IP
    job_online likes this.
  6. job_online

    job_online Active Member

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #6
    Here is how Ive don it:

    ## BROWSER CACHE ##
    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On
    # Default directive
    ExpiresDefault "access plus 2 days"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"
    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    # CSS
    ExpiresByType text/css "access 2 days"
    # Javascript
    ExpiresByType application/javascript "access plus 2 days"
    </IfModule>
    ## BROWSER CACHE ##

    Values depends on type of site you run, news site would have shorter expiry times...
     
    job_online, Feb 5, 2013 IP
  7. chetanmadaan

    chetanmadaan Active Member

    Messages:
    325
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #7
    so, i don't have to do this per file then and can do it for file types... all at once.

    Great!
     
    chetanmadaan, Feb 5, 2013 IP
  8. job_online

    job_online Active Member

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #8
    Thats correct, you can shorten it even more how ryan_uk suggested:
    gif|jpe?g|png

    You can do this both per domain via htaccess file or on server in httpd.conf (if apache) if you host your own sites via VPS or dedicated
     
    job_online, Feb 5, 2013 IP
  9. chetanmadaan

    chetanmadaan Active Member

    Messages:
    325
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #9
    yes... we are on a dedicated and this would for me... Thanks a bunch.
     
    chetanmadaan, Feb 5, 2013 IP
  10. #10
    cool, i suggest you to install eaccelerator or similar/approprite plugin for server platform you run if you dont have it, it will make a huge difference in php execution time and connected with that will improve complex platforms load time
     
    job_online, Feb 5, 2013 IP
  11. chetanmadaan

    chetanmadaan Active Member

    Messages:
    325
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #11
    Thank you so much.
     
    chetanmadaan, Feb 5, 2013 IP
  12. job_online

    job_online Active Member

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #12
    Your' welcome ;)
     
    job_online, Feb 5, 2013 IP
  13. chetanmadaan

    chetanmadaan Active Member

    Messages:
    325
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #13
    I got the work from my hosting... Any tips?

    We do not recommend, support, or install eAccelerator. If you look at their wiki page at https://github.com/eaccelerator/eaccelerator/wiki , you'll see it has not been maintained in years. PHP 5.3 and newer are already highly optimized and installing eAccelerator could actually hurt performance.

    You should consider APC and/or memcache instead, depending on your needs. Please keep in mind that your scripts must be aware of memcache for any benefits.
     
    chetanmadaan, Feb 5, 2013 IP
  14. job_online

    job_online Active Member

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #14
    Go 4 APC and memcache - both are good modules, eaccelerator can hurt performance same way any other module do, but in 99% it will increase performance
     
    job_online, Feb 5, 2013 IP
  15. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #15
    memcache.
     
    cesurasean, Feb 19, 2013 IP