A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Serverside caching with PHP

  1. #1
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045

    Serverside caching with PHP

    Anyone have any good resources on the best practices for doing this?

    Say I have dynamic content. For example a blog. But I want to cache some of the less dynamic pages in a static html file in a cache folder, and have this on a time period. Say cache, file a for 24 hours.

    I can devise some methods, but I want to know how some bigger online applications are handling it to learn it the proper way.

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    I think there is a nice example in the mod_rewrite docs

    Musicman

  3. #3
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    I was reading about it in my Advanced PHP Programming book using mod_rewrite, but is that the suggested way? I know applications like Wordpress don't do it that way. And I don't think that method would be too easy to stick into an MVC style, unless I am mistaken a bit?

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    my understanding was that mod_rewrite would require less changes on an existing script that always regenerates pages ... and of course it would allow for big applications to split off a separate caching server

    Musicman

  5. #5
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    Thanks for the input.

    I've been messing around with using mod_rewrite, and also integrating a Cache class into my application.

    Would it benefit the server to do the straight mod_rewrite for a file? Or in the Cache class, serving up the static html document?

    Also if I'm using mod_rewrite for caching, is there a way that I can have the Cached documents expire after aging? Sans running a cron-job.

    On a side note, are there any ways that I can perform a test for how CPU intensive a script is? I want to work on optimizing my sites for large scale and I'd like to gauge how well it's doing on a small scale first and determine if it'll expand well.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center