Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7582307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:24:14+00:00 2026-05-30T18:24:14+00:00

I have a dynamic php (Yii framework based) site. User has to login to

  • 0

I have a dynamic php (Yii framework based) site. User has to login to do anything on the site. I am trying to understand how caching and CDN work; and I am a bit confused.

Caching (memcache):

My site has a good amount of css, js, and images. I’ve been given to understand that enabling caching (“memcache”?) will GREATLY speed up my site. But this has me confused. How does caching help? I mean, how can you cache something that’s coming out of DB for each user separately? For instance, user-1 logs-in, he sees his control panel. User-2 logs-in, user 2 will see their control panel.

How do I determine what to cache? Plus, how do I enable caching (memcaching)?

CDN:

I have been told to use a content delivery network like CloudFlare. It is suppose to automatically cache my site. So, when my user-1 logs in, what will it cache? Will it cache only the homepage CSS, JS, and homepage images? Because everything else requires login? What happens when user logs-out? I mean, do “sessions” interfere with working of a CDN?

Does serving up images via CDN reduce significant load on my server? I don’t have much cash for getting a clustered-server configuration. So, I just want my (shared) server to be able to devote all its resources in processing PHP code. So, how much load can I save by using “caching” (something like memcache) and/or “CDN” (something like CloudFlare)?

Finally,

What would be general strategy to implement in this scenario for caching, cdn, and basic performance optimization? do I need to make any changes to my php-code to enable CDN like CloudFlare and to enable/implement/configure caching? What can I do that would take least amount of developer/coding time and will make my site run much much faster?

Oh wait, some of my pages like “about us” page etc. are going to be static html too. But they won’t get as many hits. Except for maybe the iFrame page that will be used for my Facebook Page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:24:15+00:00Added an answer on May 30, 2026 at 6:24 pm

    Caching helps because instead of performing disk io for each user the data is stored in the memory, ie memcached. This provides a SIGNIFICANT increase in performance.

    Memcache is generally used for cacheing data ie query results.
    http://pureform.wordpress.com/2008/05/21/using-memcache-with-mysql-and-php/
    There are lots of tutorials.

    I have only ever used amazon s3 which is is not quite a cdn. It is more of a storage platform but still it helps to take the load off of my own servers when serving media.

    I would put all of your static resources on a CDN so your own server would not have to serve these. It would not require any modifcation to your php code. This includes JS, and CSS.
    For your static pages (your about page) I’d make sure that php isn’t processing that since there is no reason for it. Your web server should serve it directly.

    Cacheing will require changes to your code. For cacheing a normal flow is:
    1) user makes a request
    2) check if data is in cache
    3) if it is not in cache do the DB query and put it in cache
    4) if it is in cache retrieve it
    5) return data.

    You can cache anything that requires disk io and you should see a speed up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the problem I'm trying to solve: I have a dynamic php-driven website that
I am using jQuery datatables in a dynamic PHP site. I have a page
i have single php dynamic page that load image each time app user is
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have some PHP code that generates dynamic tables of data on the fly.
I have a dynamic input in my php code like this one: <input type=checkbox
So I am trying to have a dynamic tabs kind of thing using both
I have a slight problem with .htaccess redirect. I have a dynamic site with
I have a dynamic php page which I need to call with a get
I'm trying to get an html table from a dynamic php page on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.