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.

Best form of caching?

Discussion in 'PHP' started by Silver89, Mar 24, 2012.

  1. #1
    I'm re-coding a site from the ground up to use an mvc structure and I'm now at the point to decide on which type/s of caching to use to lower the database queries and also speed up the page build times.

    The database queries in the model currently operate with pdo queries and I'm thinking about using memcache to store these and reduce the load?

    However, at the moment everything (database, files, etc) are all on one server and I'm not sure there's much of a benefit to using Memcache when it's not a distributed setup?

    I've heard briefly about ACP but not sure of what that is?

    Any recommendations as to the best caching options?
     
    Silver89, Mar 24, 2012 IP
  2. Nikolas

    Nikolas Well-Known Member

    Messages:
    1,022
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    150
    #2
    Memcache is great, and having it on the same server makes it even faster.

    Apc is good for byte code caching. That means that you can use it to have php run faster.

    I am using both and they work great, so go ahead with this setup ;)
     
    Nikolas, Mar 24, 2012 IP
    Silver89 likes this.
  3. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #3
    APC is really good. Enable MySQL query caching if you have a lot of the same queries. Memcache is also good but I think you need to consider it during development rather than just enable a configuration settings for it. (like APC).

    If you're developing an app from the ground up using MVC, consider Zend or Symfony. Most frameworks have built in caching so it's already available.
     
    mfscripts, Mar 30, 2012 IP
  4. www.seotest.com

    www.seotest.com Well-Known Member

    Messages:
    77
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    168
    #4
    We use combination of PEAR Cache_lite and Memcached.
    It's easy to setup and very usefull.
     
    www.seotest.com, Apr 2, 2012 IP
  5. jkon

    jkon Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Caching is not something that has a single way (for me), I understand that many may disagree in order to make a more general use caching way but this is just an opinion. It all depends on what are you caching and why. So in my view there are three (main) caching scopes, visit scope caching (caching objects for use in the current visit), application scope caching (caching objects for the application and the Controller used) and caching binds (application scope caching based on given ids). In visit scope caching you can use session with really no cost, with application scope caching you can use file system with only cost deserialization-serialization the same goes for caching binds. Of course Memcached is a good way to go if you don’t like to change to much your app but you should take a moment thinking what are you caching and why to understand the way could be done in source.
     
    jkon, Apr 3, 2012 IP