|

WordCamp GR 2017 – WP-API: The Good, the Bad, and the Ugly – J Andrew Scott

J Andrew Scott – http://rubberchickenfarm.com/

History of APIs

  • RSS
    • Advantages
      • Fast & reliable
      • Easy to consume
      • Almost no technical footprint
    • Disadvantages
      • Read-only
      • Static content
      • No authentication
      • No user-driven content (i.e. comments, favorites, etc)
  • DIY API
    • Advantages
      • Dynamic content
      • User-driven content
      • App & user authentication
      • Roles & permissions based
      • Connected applications
    • Disadvantages
      • DIY OAuth
      • Redundant URI scheme
      • Mediocre performance
      • Large technical footprint
  • WP-API
    • Advantages
      • Succinct URI scheme
      • Improved performance
      • Small technical footprint
      • Available in WordPress core
    • Disadvantages
      • Granular transactions
      • No batch uploads
      • Increased number of API calls
      • What once required 2 web servers now required 12-15 servers

WP-API Disadvantage Factors & Solutions

  • Number of content types
    • Solution: consolidate endpoints
  • Volume of individual API calls
    • Solution: batch processing endpoints
  • Frequency of individual API calls
    • Solution: page-level caching

Lessons Learned

  • Use standard authentication methods
  • Use page-level caching on GET requests
    • Varnish
    • WordPress object caching
  • Use custom endpoints
    • for upload of large batches of content
    • for consolidating repetitive API calls

Similar Posts

  • | | | | | | |

    Being A Developer For Life…Can I Keep It Up?

    photo credit: LeeroyBy now you’ve probably seen the viral clip of a father getting interrupted by his children while giving a live interview on BBC. Working parents everywhere, especially remote workers, could identify with the humorous embarrassment of the situation. Even those who have had pets interrupt Skype calls know the feeling. You want to… via…
  • |

    Using WordPress As My Note Taking Tool

    So this past Sunday, in a continued effort to find my replacement note taking tool for Evernote, I decided to give my blog a try as a not taking tool. I have the Android app on my phone and tablet so that step made things fairly easy. For the most part things went very well,…
  • | | | |

    Fixing OpenLiteSpeed Caching for ActivityPub on WordPress

    After some conversation with others on #Mastodon about other caching issues with #ActivityPub & #WordPress it was revealed that it came down to the Accept headers being received by requests to the caching services. The caching services could be things like #Cloudflare or web servers such as #OpenLiteSpeed, or even WordPress caching plugins. In my case I use the OpenLiteSpeed web server caching and I started digging into how caching works in OpenLiteSpeed and how I could fix it for my WordPress site.
  • |

    WordCamp GR 2017 – Computers <3 Structured Data – Steve Grunwell

    Steve Grunwell – https://stevegrunwell.com/ https://github.com/stevegrunwell/structured-data/blob/master/README.md What is Structured Data? Standards to help computers to understand our content. Content is for humans. Structured data is for machines. Structured Data Structured data is all about providing context itemtype/itemprop/content HTML/XML HyperText and eXtensible Markup Language Meant to convey information in a meaningful way Generic layout RSS An extension of…
  • | | | | |

    WordPress Meetup – February 2019

    Show & Tell Grammarly – Proofreading Google Docs – for writing Zoho – online productivity suite Invoicely – Small business client management & automation Plutio – Project management WordPress.org Favorites – When installing new plugins you can use favorites and use any WordPress.org username. WordPress Plugins TablePress Advanced Custom Fields Block Lab WordPress Themes Hestia…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)