+ Reply to Thread
Results 1 to 6 of 6

Thread: Here is how to use Caching with DAP and WordPress

  1. #1
    GoodLearning.com Director
    Join Date
    Apr 2012
    Location
    Champaign, IL
    Posts
    3

    Lightbulb Here is how to use Caching with DAP and WordPress

    It might seem a bit overkill to say caching will not work at all with a Membership site. However, caching is a big issue, and if DAP or any other membership pluging tried to help us make it work, they would spend a LOT of time troubleshooting for us. So, I understand the DAP team keeping caching at arm's length.

    For what it is worth, this caching issue is not unique to DAP. I have used MagicMembers and Your Members, and previewed many others. The caching issue is one of concept -- not a limitation in the plugins.

    Let me tell you what is working for me.
    1. My membership site's paid content is primarily videos and downloads to accompany the videos.

    2. In order to use caching, you need to make sure that NO content that is member-specific gets cached. That is, any part of the site that changes based on whether or not someone is logged in -- should not be cached.

    3. At first it seems this means you cannot use caching, but if you set your site up with a certain information architecture, you can make it work. Here is my information architecture, and I have noted next to the pages whether they are PUBLIC and whether they are CACHED. In WordPress, these are PAGE content type, so they are hierarchical.

    Home (PUBLIC, CACHED)
    * Information Pages, such as About, Contact, Terms, etc. (PUBLIC, CACHED)
    * Sales Page (PUBLIC, CACHED)
    * * Purchase Page 1, with Free button (PUBLIC, CACHED)
    * * Purchase Page 2, with DAP Paypal button (PUBLIC, CACHED)

    * Game Projects Page, parent of most content (PUBLIC, CACHED)
    * * Game Project 1 Page, parent of one specific project (PUBLIC, CACHED)
    * * * Game Project 1 Lesson 1 Page, describing what you learn in lesson, etc. (PUBLIC, CACHED)
    * * * * Game Project 1 Lesson 1 Content, the protected video / download (PRIVATE, NOT CACHED, NOFOLLOW, NOINDEX)
    * * * Game Project 1 Lesson 2 Page, describing what you learn in lesson, etc. (PUBLIC, CACHED)
    * * * * Game Project 1 Lesson 2 Content, the protected video / download (PRIVATE, NOT CACHED, NOFOLLOW, NOINDEX)

    * * Game Project 2 Page, parent of one specific project (PUBLIC, CACHED)
    * * * Game Project 2 Lesson 1 Page, describing what you learn in lesson, etc. (PUBLIC, CACHED)
    * * * * Game Project 2 Lesson 1 Content, the protected video / download (PRIVATE, NOT CACHED, NOFOLLOW, NOINDEX)
    * * * Game Project 2 Lesson 2 Page, describing what you learn in lesson, etc. (PUBLIC, CACHED)
    * * * * Game Project 2 Lesson 2 Content, the protected video / download (PRIVATE, NOT CACHED, NOFOLLOW, NOINDEX)

    4. I do not allow comments on any of these WordPress pages. At first, I was thinking about SEO and keeping the pages tidy, so I provide a link on each Project / Lesson page to a SimplePress forum specific to that project and its lessons. Commenting / questions are to be in the forum, not on the page. This also allows me better control over the comments and questions -- I prune and moderate aggressively to maintain the value of the threads.

    If I allowed comments on the actual pages, then caching would add a delay to when comments were updated. That's just a bummer, to have that lag.

    5. I use the "WordPress SEO by Yoast" plugin to add the NOFOLLOW and NOINDEX to the Private content pages.
    http://wordpress.org/extend/plugins/wordpress-seo/

    6. WordPress also puts this admin bar at the top of every page when you are logged in, for any user. We need that to go away, because otherwise that bar gets cached for "Bob Smith" or whomever, and then when "Jane Jones" logs in, she get's Bob's cached version and is all confused.

    To eliminate that admin bar, then, I use the "ToolBar Removal completely disable" plugin:
    http://wordpress.org/extend/plugins/wp-toolbar-removal/

    This means if you need users to be able to Logout, you need to supply them with a Logout link somewhere, like in your sidebar or something.

    7. Remember, I said that to cache a page, you need to make sure there is nothing on that page that is member-specific. That means you cannot use any tags that make the page partially protected. Sorry, you cannot have your cake and eat it, too. If you want to use caching on a page, then the page needs to not have any member-specific content or changes, period.
    (Well, okay, there are ways to make it work, but it is not worth the time, and relies on cookies, so is unreliable.)

    8. I am using W3TC plugin for caching.

    I also use it with MaxCDN for CDN hosting. Just FYI, I tried to use my Amazon S3 or Amazon CloudFront for CDN (I am already using that for videos / downloads) but I could not get W3TC to work right with it. Time is money, so I said forget it. In 15 minutes, I had MaxCDN working just fine, and the price is right.

    The W3TC guy will optimize W3TC for your site for a fee. In hindsight, I should have paid him $150 to get this done. It would have saved me money in the long run. But oh, well, I am now all the wiser.

    9. I am using Shared Hosting right now on HostGator. I tried VPS.net but there was too much setup involved. Once I have outgrown the Shared hosting I will likely move to Site5 VPS (I have had issues with HostGator VPS. Their shared is great, their VPS is another story.)

    10. Telling W3TC which pages to not cache.
    Since my site is largely based on Pages, I can easily assign specific page templates to certain pages. It turns out that if you put the following line above the "get_header()" call in your page template, W3TC will not cache anything using that template.

    The line:
    define('DONOTCACHEPAGE', true);

    11. So, I made page templates for use on:
    a. Register page
    b. Member info page
    c. Forums page (one page that SimplePress gets assigned to.)
    d. Lesson (Private) page
    ... and any other type of page I need to not cache, because it contains member-specific info.
    NOTE: I could also create a generic "Normal Page NOCACHE" I suppose, but I didn't really need that.

    12. In Conclusion
    Well, I have to get busy! I hope this has given you a bit to think about. If you have any questions, please reply here on the forum and I will try to help you out if I have time. Good Luck!
    ----------
    Learn to make your own game art and games.
    GoodLearning.com

  2. #2
    Administrator
    Join Date
    Nov 2010
    Posts
    648

    Re: Here is how to use Caching with DAP and WordPress

    Awesome stuff. We are very impressed .
    Thanks Paul for taking the time to help DAP users and us.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    7

    Re: Here is how to use Caching with DAP and WordPress

    Seems like I am having the same issue with hostgator... what should I do?

  4. #4
    Junior Member
    Join Date
    Feb 2013
    Posts
    6

    Re: Here is how to use Caching with DAP and WordPress

    Useful discussion.....

    However, I did try to use W3T Total Cache with DAP and bad things happened even with minimal W3TC things enabled.
    o The Javascript tiny stuff made things not work right.
    o Even with Paul's seemingly good recommendation to exclude caching for DAP protected content, using the login/logout widget wrecked havoc. The login/logout widget is on non-protected content and what happened is the widget didn't change from login to logout on these pages, presumably because they were page cached.

    I gave up pretty quickly using any caching. Maybe it won't really be needed at all for our site - fingers crossed. Although, we hope to get enough users where we might care. Such a dilemma. ;-)

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    2

    Re: Here is how to use Caching with DAP and WordPress

    I'm using WP Super Cache. Made a few adjustments - separated the member stuff from other static content with a hierarchical structure. So, for example, all member items put under the structure /member - such as /member/login, /member/affiliate, /member/home, /member/contenta, /member/contentb, etc. Then excluded all strings that contain /member in WP Super Cache.

    Static content seems to load quickly now & member stuff loads 'regular' speed with no login, access, etc. errors anymore.

    Hope this helps.

    Gary.

  6. #6
    Administrator
    Join Date
    Nov 2010
    Posts
    648

    Re: Here is how to use Caching with DAP and WordPress

    That's great. Thanks Gary for the update.

+ Reply to Thread

Tags for this Thread

Posting Permissions

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