+ Reply to Thread
Results 1 to 10 of 10

Thread: Question about Caching

  1. #1
    djalam is offline x10Hosting Member djalam is an unknown quantity at this point
    Join Date
    Jan 2008
    Posts
    71

    Question about Caching

    http://bit.ly/fjMoS Read that, about caching files. Is it a good idea? or is it a system resourse hog. If you are making like a list of 10 things with description. Nothing too big.

  2. #2
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Question about Caching

    I can't read the article at the moment (chrome keeps trying to translate everything into german), but I know that caching uses a lot of resources (a lot of free hosting suspensions are from caching scripts)

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  3. #3
    dWhite Guest

    Re: Question about Caching

    I'm not clicking on that link.

    Show us the real URL.

  4. #4
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Question about Caching

    This is the real URL, not that you should really be worrying about it: http://www.gayadesign.com/diy/cachin...l-data-in-php/

    Depending upon how extensively you use caching, it is very possible that you will overrun your resource limit and land yourself a suspension.
    Last edited by lemon-tree; 08-21-2010 at 11:28 AM.

  5. #5
    dWhite Guest

    Re: Question about Caching

    Quote Originally Posted by lemon-tree View Post
    This is the real URL, not that you should really be worrying about it: http://www.gayadesign.com/diy/cachin...l-data-in-php/
    Thanks lemon. I never click on shortened URLs. Way too much possibility for a hidden affiliate/referral link, and/or malicious stuff that could start attacking / attemping to attack my system (granted I am running linux, we can still get infected with linux viruses/malware).
    Last edited by dWhite; 08-21-2010 at 11:32 AM.

  6. #6
    djalam is offline x10Hosting Member djalam is an unknown quantity at this point
    Join Date
    Jan 2008
    Posts
    71

    Re: Question about Caching

    Gotcha, thanx for the heads up.Won't be doing that now. I only looked into it to see if it helps limit the strain on the database query. Thanx. And yeah lol didn't want to alarm anyone with short url my bad.

  7. #7
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Re: Question about Caching

    Well, I am using caching on my phpbb site and it is not suspended till now.May be because it has only four posts and four members. :D

    Well seriously if I deploy any web application(Specifically Joomla, WordPress or Zend framework project) that uses file based caching can it be a resource hogger?Caching saves us resources then how it can be a resource hogger?

    I have seen high resource usage suspension of many WordPress users because of the plugins they use.
    Liked this? Click on the icon on the bottom of post to make me .

  8. #8
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: Question about Caching

    During the process of building the cache it uses up a lot resources (CPU mainly, but also ram), depending on how much content has to be added in the same run, and I'd assume a bit on how the caching is actually done.

    Once the content is added to cache, the resources they save is mainly bandwidth, and it may speed up the page load for the end viewer a little, often not really noticable.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  9. #9
    misson is online now x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Question about Caching

    It's not so much that caching requires more resources as it trades space for another resource, such as (processor) time or bandwidth.

    In storing and reusing the results of (expensive) computations, additional space is used but time can be saved; PHP accelerators are an example of this, as is memoization. As the gaps between processor and memory performance and processor and I/O performance increase (processors have been outstripping the other two), space becomes more and more valuable. Consequently, computational tasks must be correspondingly more expensive to make caching them worthwhile. Due to PHP's architecture (at the end of a script's execution, all data is discarded), cached data can't be stored in memory, so some form of persistent storage must be used instead. Disk storage speed is extremely slow relative to processor speed, so that option usually isn't worth it, but relegating storage to a DB (which can be forced to store the data in memory) may be viable.

    As for network caching, the factors affecting its utility are network latency (~ 10-100ms) and goodput (~ 128kB/s-1GB/s for high speed, though not many connections will run at the upper end of that range), disk access time (~ 6-26ms) and throughput (~ 50-400 MB/s), available storage space (currently unmetered, so I'm not certain what the limits are) and the hit rate. From the first four statistics, we can expect that fetching data from disk is (very) roughly 10-20 times as fast as from the network (which puts an upper limit on how much caching will improve performance), with latency being comparable. The statistical ranges given reflect the variance between hosts; on a given host, the statistics will be more consistent. Hit rate will vary wildly, depending on storage space and the exact order that items are requested. Hit rate will scale the upper limit on performance increase; with a hit rate of (e.g.) 50%, we should expect at most a 5-to-10-fold performance increase from network caching. If you're fetching small amounts of data (on the order of 10**5 B, roughly), service time won't be much improved by caching; if it takes more than a few seconds for the server to fetch data per request, caching should give a noticeable improvement in performance.

    Network caching is a subset of caching data from I/O bound processes. Caching search results is another, which can be advantageous if there is a large amount of data that must be examined for each search.

    Your best bet is to design your site without caching, but make it easy to add it later on, if necessary. It's best to optimize later in the development process, once you've got a solid design and a working system.
    Last edited by misson; 08-23-2010 at 02:31 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  10. #10
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Question about Caching

    Quote Originally Posted by bhupendra2895 View Post
    Well, I am using caching on my phpbb site and it is not suspended till now.May be because it has only four posts and four members. :D
    phpBB only caches the style, so that it doesn't have to be parsed every time, therefore using less resources. It also caches config.

    ~Callum
    Last edited by callumacrae; 08-23-2010 at 09:30 AM.
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

+ Reply to Thread

Similar Threads

  1. Caching in SMF
    By smartflight in forum Free Hosting
    Replies: 3
    Last Post: 03-16-2010, 11:40 AM
  2. PHP caching
    By zordon19 in forum Programming Help
    Replies: 0
    Last Post: 12-17-2009, 07:08 AM
  3. About web caching
    By radofeya in forum Programming Help
    Replies: 6
    Last Post: 07-17-2008, 12:47 PM
  4. Caching Questions
    By Veridis in forum Programming Help
    Replies: 9
    Last Post: 04-11-2008, 01:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers