Results 1 to 4 of 4

Thread: Dynamic page caching

  1. #1
    Join Date
    Mar 2011
    Location
    N 11° 19' 0.0012 E 142° 15' 0
    Posts
    1,515
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default Dynamic page caching

    Hey all
    First off, I'd like to start with this:
    Where should you store page caches? Flat files or DB?

    Secondly: What's the advantage of caching a page that is updated very frequently (e.g. fb) or a page that is customized to a single user?
    Thanks

  2. The Following User Says Thank You to keyboard For This Useful Post:

    bernie1227 (03-11-2013)

  3. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Caching can be implemented in many ways. It trades more storage space for less processing.

    What exactly are you trying to do? The answer will depend on that.

    Where should you store page caches? Flat files or DB?
    Depends on your goals. You might store cached information in the db if it's something that takes a lot to process (perhaps some accumulated value from calculating something about 50 entries). Or you might store a full HTML page as a file after generating it one time from the database.
    As an extreme example, if you're making images using PHP's GD library, you'd want to save those as files rather than re-process them each time-- that's a form of caching too.

    Secondly: What's the advantage of caching a page that is updated very frequently (e.g. fb) or a page that is customized to a single user?
    Probably none. It might be a waste of space then. You need to use the cache more than 1 time for it to be useful. In fact, if the page is constantly being updated, the cache could be counterproductive-- it might stop the user from seeing the newest content (unless that's acceptable).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #3
    Join Date
    Mar 2011
    Location
    N 11° 19' 0.0012 E 142° 15' 0
    Posts
    1,515
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    Hmmm... I remember a while ago Adrain says FB caches a lot... Adrian?

  5. The Following User Says Thank You to keyboard For This Useful Post:

    bernie1227 (03-11-2013)

  6. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Facebook isn't cached, not entirely. But it certainly can use caching to save frequently accessed parts of the site.

    Another option (something I've set up on one of my sites) is to check when the content was last updated (you need a "last updated" table in your database, or to save a date in your existing tables) then:
    1. check if there is a cached version.
    2. If so, is that cached version newer than the latest update?
    3. If so, display it.
    4. If no accurate cached version is found, re-process and save that in the cache.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Similar Threads

  1. Replies: 4
    Last Post: 09-29-2012, 07:57 AM
  2. DD tabs + jQuery toggle Div? Turn OFF page caching?
    By ryanpaulyoung in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 11-28-2007, 11:39 PM
  3. ajaxcontent caching
    By itKiwi in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 03-18-2006, 04:49 PM
  4. Dynamic Ajax Content - caching problem
    By rleeden in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-08-2006, 10:16 AM
  5. Images + caching
    By holobyted in forum PHP
    Replies: 6
    Last Post: 07-12-2005, 06:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •