Author Topic: Client question: How do you handle caching?  (Read 4087 times)

Offline Doug Hazard

  • Richweb Staff (Admin)
  • Newbie
  • *
  • Posts: 30
  • CFB / MBB Junkie
Client question: How do you handle caching?
« on: February 02, 2015, 11:35:15 am »
This came from a Tech Admin for one of our clients (non-sports site). Figured that it would be incredibly informative to share with everyone else.

NOTE: Even though this mentions the Drupal software package, the answer is applicable to any software package/content management system used within our hosting network.

I think I am about ready to do some optimization for the site.  You say not to use any caching within Drupal.  Are you including turning off the default caching and aggregating of css and javascript files within Drupal core as well, since it is usually considered best practice to leave that on?  What caching system are you planning on using?  Does it only work for anonymous users or for authenticated sessions as well?  I am just wondering since this is a commerce site and has lots of forms. Most of those pages can't be fully cached or the anti spam features will fail.  If I know how you are planning on setting up the caching I will be better able to give you a list of things to disallow.

xCache is already enabled on the backend vServers, so all PHP code is opcode cached already.

NginX delivers all of your static assets (files, such as images, CSS style sheets and Javascript (that aren't created on the fly, aka dynamically), straight HTML, XML files (in MOST cases)) on the load balancer automatically, by looking at the file extensions.
Really, all you need to do is ensure that your CSS style sheets and Javascript files are minified (a process that reduces extra white space and possibly even combines these files into larger singular files) and you're set.

The Load Balancer will serve the minified versions unless the software package you use creates the files in PHP and adds weird variables at the end (such as filename.php?foo=bar).

Having Apache serve up minified CSS and Javascript files is actually a step backwards in internet technology. As long as your files are legitimately .css and .js, everything should be handled through the native load balancers properly!

This also means that you shouldn't need to implement any additional or special caching protocols within your own scripts unless it's absolutely necessary.
Doug "Bear" Hazard
@BearlyDoug  |  @GridironHistory  |  @Hogville |

Co-Host of Two Cents Radio, powered by the Radio Network, Wednesday Nights from 8 PM to 10 PM Central, covering SEC and Sun Belt Sports.

Listen at and follow @TwoCentsRadio on Twitter!


With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name: Email:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
Type in the underlined letters, in order as you see them. There are 6 of them.: