Skip to content

Instantly share code, notes, and snippets.

View fqjony's full-sized avatar
🎯

Dmytro Smirnov fqjony

🎯
View GitHub Profile
@fqjony
fqjony / rest-controller-extend.php
Created March 30, 2018 13:47 — forked from sagarkbhatt/rest-controller-extend.php
Sample class that extends WP rest controller
<?php
/**
* Add rest api endpoint for category listing
*/
/**
* Class Category_List_Rest
*/
class Category_List_Rest extends WP_REST_Controller {
/**

It helps to identify the type of content we will have.

  1. Content Pages - change often, most likely will have different content based on host
  2. Static Assets - scripts, styles and images. always same, even if host changes. See example #1
  3. Administrative Areas - require login and special cookies to be allowed.
  4. API and RPC - dont require cookies but should not be cached

For most dynamic pages that following headers should be allowed: