SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    "Caching" a php script

    Hello,

    In javascript, CSS, the browser can cache files so that there are fewer trips to the browser. Might there be something analogous in PHP? In particular, to keep organized, I have every function that I need for my site in one script. Each script only calls a few functions and it seems a bit of a waste of resources to read through the entire script each time. So, is it possible to either:

    1) Create "Session Functions" that can be defined once and then used while a user is logged in
    2) Somehow Cache the functions

    If neither works, then I can definitely break the functions script into smaller pieces, but I'd much prefer to leave things as is if possible.

    Thank you,

    Eric

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    It sounds like you're looking for a PHP Accelerator. There's quite a few of those out there. The most popular ones are APC and XCache AFAIK.

    There's an explanation of PHP Accelerators with a nice list over at wikipedia, here List of PHP accelerators - Wikipedia, the free encyclopedia
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Exactly what I'm looking for! Thanks so much....

    -Eric

  4. #4
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,023
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    APC becomes part of PHP core as of 5.4, so unless you specifically need a function out of one of the other accelerators I would recommend learning and using it.

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the extra info...

    -Eric


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
  •