Giter VIP home page Giter VIP logo

Comments (4)

sc0ttkclark avatar sc0ttkclark commented on June 5, 2024

I need the code needed to add/update/delete transients, object caches (w3 total cache / wp super cache compatible with memcache etc), and any other WP API's for that type of stuff.

from pods.

danlamanna avatar danlamanna commented on June 5, 2024

As far as plugin collision, you'll see as I explain throughout, object caching won't interfere, and database caching we can prefix each key. WP Super cache is file-based as far as I can tell (generates static html files for later use), and W3 doesn't seem to have information on how to work alongside them.

So I mean we'll have to decide on what we want to use with object caching and what to use for database caching, or if we just want to stick with one. One thing to point out about transient caching is you can set/get sitewide transients for WPMU networks. Obviously we'll want to create some form of wrapper for our caching system in order to handle the inner workings of user preferences on caching if we decide to do that.

As for object caching, the nice thing about avoiding conflicts is the keys can be used across multiple "groups", and you use the group to set/get the cache keys. Essentially letting us use very common keys, like 'post' or 'user', without having to worry about conflicting with anything else because we'll most likely set a group of pods_plugin or something.

First example is using transients, second is object caching, and the third discusses some possibilities for clearing cache of pods.

Gist: https://gist.github.com/1325185

from pods.

sc0ttkclark avatar sc0ttkclark commented on June 5, 2024

0a48014 introduces the new PodsView class, which handles get/set/clear of wp_cache, transients, and site transients. It also has template inclusion built in so you can call this to include a sidebar and cache it for 12000 seconds ('cache' is default cache_mode, 'transient' and 'site-transient' are also available, but you really should have a persistent cache plugin to utilize this to the maximum)

pods_view( 'includes/sidebar.php', compact( $any, $var, $you, $want, $passed ), 12000 );

That compact() function lets you put any variables you want to pass, which isn't included in a normal get_template_part() call in WP.

from pods.

sc0ttkclark avatar sc0ttkclark commented on June 5, 2024

Transients / Caching now in use within PodsAPI. Needs to be implemented into Pods class next for simple caching of normal queries.

from pods.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.