summaryrefslogtreecommitdiff
path: root/docs/build/References/Overview/index.html
blob: 6766130fd0994cfdb90abe7eb7fd12a97b8b7949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163

<!DOCTYPE html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
      
        <link rel="shortcut icon" href="../../assets/images/favicon.png">
      
      <meta name="generator" content="mkdocs-0.16.3, mkdocs-material-1.6.1">
    
    
      
        <title>References in Ponzu</title>
      
    
    
      <script src="../../assets/javascripts/modernizr-56ade86843.js"></script>
    
    
      <link rel="stylesheet" href="../../assets/stylesheets/application-4d0d3f2fbf.css">
      
        <link rel="stylesheet" href="../../assets/stylesheets/application-f78e5cb881.palette.css">
      
    
    
      
        
        
        
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
        <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
      
      <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    
    
    
  </head>
  
  
  
  
    <body data-md-color-primary="grey" data-md-color-accent="light-blue">
  
    <svg class="md-svg">
      <defs>
        
        
          <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
        
      </defs>
    </svg>
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
    <label class="md-overlay" data-md-component="overlay" for="drawer"></label>
    
      <header class="md-header" data-md-component="header">
  <nav class="md-header-nav md-grid">
    <div class="md-flex">
      <div class="md-flex__cell md-flex__cell--shrink">
        
          <a href="../.." title="Ponzu" class="md-logo md-header-nav__button">
            <img src="../../images/logo.png" width="24" height="24">
          </a>
        
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        <label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
      </div>
      <div class="md-flex__cell md-flex__cell--stretch">
        <span class="md-flex__ellipsis md-header-nav__title">
          
            
              
                <span class="md-header-nav__parent">
                  References
                </span>
              
            
            Overview
          
        </span>
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        
          <label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
          
<div class="md-search" data-md-component="search">
  <label class="md-search__overlay" for="search"></label>
  <div class="md-search__inner">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" required placeholder="Search" accesskey="s" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">
      <label class="md-icon md-search__icon" for="search"></label>
      <button type="reset" class="md-icon md-search__icon" data-md-component="reset">close</button>
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="result">
          <div class="md-search-result__meta" data-md-lang-result-none="No matching documents" data-md-lang-result-one="1 matching document" data-md-lang-result-other="# matching documents">
            Type to start searching
          </div>
          <ol class="md-search-result__list"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
        
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        <div class="md-header-nav__source">
          
            


  


  <a href="https://github.com/ponzu-cms/ponzu" title="Go to repository" class="md-source" data-md-source="github">
    
      <div class="md-source__icon">
        <svg viewBox="0 0 24 24" width="24" height="24">
          <use xlink:href="#github" width="24" height="24"></use>
        </svg>
      </div>
    
    <div class="md-source__repository">
      ponzu-cms/ponzu
    </div>
  </a>

          
        </div>
      </div>
    </div>
  </nav>
</header>
    
    <div class="md-container">
      
      
      <main class="md-main">
        <div class="md-main__inner md-grid" data-md-component="container">
          
            
              <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    <nav class="md-nav md-nav--primary" data-md-level="0">
  <label class="md-nav__title md-nav__title--site" for="drawer">
    
      <i class="md-logo md-nav__button">
        <img src="../../images/logo.png">
      </i>
    
    Ponzu
  </label>
  
    <div class="md-nav__source">
      


  


  <a href="https://github.com/ponzu-cms/ponzu" title="Go to repository" class="md-source" data-md-source="github">
    
      <div class="md-source__icon">
        <svg viewBox="0 0 24 24" width="24" height="24">
          <use xlink:href="#github" width="24" height="24"></use>
        </svg>
      </div>
    
    <div class="md-source__repository">
      ponzu-cms/ponzu
    </div>
  </a>

    </div>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      


  <li class="md-nav__item">
    <a href="../.." title="Home" class="md-nav__link">
      Home
    </a>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
    
    <label class="md-nav__link" for="nav-2">
      CLI
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-2">
        CLI
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../CLI/General-Usage/" title="General Usage" class="md-nav__link">
      General Usage
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../CLI/Generating-References/" title="Generating References" class="md-nav__link">
      Generating References
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
    
    <label class="md-nav__link" for="nav-3">
      Content
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-3">
        Content
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Content/An-Overview/" title="An Overview" class="md-nav__link">
      An Overview
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Content/Extending-Content/" title="Extending Content" class="md-nav__link">
      Extending Content
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
    
    <label class="md-nav__link" for="nav-4">
      Form Fields
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-4">
        Form Fields
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Form-Fields/HTML-Inputs/" title="HTML Inputs" class="md-nav__link">
      HTML Inputs
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
    
    <label class="md-nav__link" for="nav-5">
      HTTP APIs
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-5">
        HTTP APIs
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../HTTP-APIs/Content/" title="Content" class="md-nav__link">
      Content
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../HTTP-APIs/File-Metadata/" title="File Metadata" class="md-nav__link">
      File Metadata
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../HTTP-APIs/Search/" title="Search" class="md-nav__link">
      Search
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
    
    <label class="md-nav__link" for="nav-6">
      Interfaces
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-6">
        Interfaces
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Interfaces/API/" title="API" class="md-nav__link">
      API
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Interfaces/Editor/" title="Editor" class="md-nav__link">
      Editor
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Interfaces/Format/" title="Format" class="md-nav__link">
      Format
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Interfaces/Item/" title="Item" class="md-nav__link">
      Item
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Interfaces/Search/" title="Search" class="md-nav__link">
      Search
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7">
    
    <label class="md-nav__link" for="nav-7">
      Ponzu Addons
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-7">
        Ponzu Addons
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Ponzu-Addons/Creating-Addons/" title="Creating Addons" class="md-nav__link">
      Creating Addons
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../Ponzu-Addons/Using-Addons/" title="Using Addons" class="md-nav__link">
      Using Addons
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8">
    
    <label class="md-nav__link" for="nav-8">
      Quickstart
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-8">
        Quickstart
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Quickstart/Overview/" title="Overview" class="md-nav__link">
      Overview
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      

  


  <li class="md-nav__item md-nav__item--active md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9" checked>
    
    <label class="md-nav__link" for="nav-9">
      References
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-9">
        References
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          

  


  <li class="md-nav__item md-nav__item--active">
    
    <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
    
    
      <label class="md-nav__link md-nav__link--active" for="toc">
        Overview
      </label>
    
    <a href="./" title="Overview" class="md-nav__link md-nav__link--active">
      Overview
    </a>
    
      
<nav class="md-nav md-nav--secondary">
  
  
  
    <label class="md-nav__title" for="toc">Table of contents</label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#create-your-content-types" title="Create Your Content Types" class="md-nav__link">
    Create Your Content Types
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#designed-for-http2" title="Designed For HTTP/2" class="md-nav__link">
    Designed For HTTP/2
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#requestresponse-multiplexing" title="Request/Response Multiplexing" class="md-nav__link">
    Request/Response Multiplexing
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#server-push" title="Server Push" class="md-nav__link">
    Server Push
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#example" title="Example" class="md-nav__link">
    Example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#other-considerations" title="Other Considerations" class="md-nav__link">
    Other Considerations
  </a>
  
</li>
      
      
      
    </ul>
  
</nav>
    
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10">
    
    <label class="md-nav__link" for="nav-10">
      Running Backups
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-10">
        Running Backups
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../Running-Backups/Backups/" title="Backups" class="md-nav__link">
      Backups
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-11" type="checkbox" id="nav-11">
    
    <label class="md-nav__link" for="nav-11">
      System Configuration
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-11">
        System Configuration
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../System-Configuration/Settings/" title="Settings" class="md-nav__link">
      Settings
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-12" type="checkbox" id="nav-12">
    
    <label class="md-nav__link" for="nav-12">
      System Deployment
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-12">
        System Deployment
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../../System-Deployment/Docker/" title="Docker" class="md-nav__link">
      Docker
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../../System-Deployment/SysV-Style/" title="SysV Style" class="md-nav__link">
      SysV Style
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    
<nav class="md-nav md-nav--secondary">
  
  
  
    <label class="md-nav__title" for="toc">Table of contents</label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#create-your-content-types" title="Create Your Content Types" class="md-nav__link">
    Create Your Content Types
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#designed-for-http2" title="Designed For HTTP/2" class="md-nav__link">
    Designed For HTTP/2
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#requestresponse-multiplexing" title="Request/Response Multiplexing" class="md-nav__link">
    Request/Response Multiplexing
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#server-push" title="Server Push" class="md-nav__link">
    Server Push
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#example" title="Example" class="md-nav__link">
    Example
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
        <li class="md-nav__item">
  <a href="#other-considerations" title="Other Considerations" class="md-nav__link">
    Other Considerations
  </a>
  
</li>
      
      
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content">
            <article class="md-content__inner md-typeset">
              
                
                
                  <h1>Overview</h1>
                
                <p>References in Ponzu allow you to create relationships between your Content types.
Ponzu uses an embedded database, rather than a more traditional relational database 
with SQL support. This may seem unnatural since there is no native concept of
"foreign keys" or "joins" like you may be used to. Instead, Ponzu wires up your
data using references, which are simply URL paths, like <code>/api/content?type=Post&amp;id=1</code></p>
<p>A foreign key as a URL path?! Am I crazy? No! For the purpose Ponzu serves, 
this structure works quite well, especially given its creation was specifically 
tuned for HTTP/2 features such as "Request/Response Multiplexing" and "Server Push." </p>
<p>There is a deeper dive into the HTTP/2 concepts <a href="../../References/Overview/#designed-for-http2">below</a>, but first we'll walk through
a quick tutorial on Ponzu's references. </p>
<p>To generate references from the CLI, please <a href="../../CLI/Generating-References">read through the documentation</a>. 
The example below assumes you understand the syntax. </p>
<hr />
<h3 id="create-your-content-types">Create Your Content Types<a class="headerlink" href="#create-your-content-types" title="Permanent link">&para;</a></h3>
<p>Here we are creating two Content types, <code>Author</code> and <code>Book</code>. A <code>Book</code> will keep
a reference to an <code>Author</code> in the sense that an author wrote the book.</p>
<div class="codehilite"><pre><span></span>$ ponzu gen c author name:string photo:string:file bio:string:textarea
$ ponzu gen c book title:string author:@author,name pages:int year:int
</pre></div>


<p>The structs generated for each look like:</p>
<p><code>content/author.go</code></p>
<div class="codehilite"><pre><span></span><span class="kd">type</span> <span class="nx">Author</span> <span class="kd">struct</span> <span class="p">{</span>
    <span class="nx">item</span><span class="p">.</span><span class="nx">Item</span>

    <span class="nx">Name</span>  <span class="kt">string</span> <span class="s">`json:&quot;name&quot;`</span>
    <span class="nx">Photo</span> <span class="kt">string</span> <span class="s">`json:&quot;photo&quot;`</span>
    <span class="nx">Bio</span>   <span class="kt">string</span> <span class="s">`json:&quot;bio&quot;`</span>
<span class="p">}</span>
</pre></div>


<p><code>content/book.go</code></p>
<div class="codehilite"><pre><span></span><span class="kd">type</span> <span class="nx">Book</span> <span class="kd">struct</span> <span class="p">{</span>
    <span class="nx">item</span><span class="p">.</span><span class="nx">Item</span>

    <span class="nx">Title</span>  <span class="kt">string</span> <span class="s">`json:&quot;title&quot;`</span>
    <span class="nx">Author</span> <span class="kt">string</span> <span class="s">`json:&quot;author&quot;`</span>
    <span class="nx">Pages</span>  <span class="kt">int</span>    <span class="s">`json:&quot;pages&quot;`</span>
    <span class="nx">Year</span>   <span class="kt">int</span>    <span class="s">`json:&quot;year&quot;`</span>
<span class="p">}</span>
</pre></div>


<p>Notice how the <code>Author</code> field within the <code>Book</code> struct is a <code>string</code> type, not
an <code>Author</code> type. This is because the <code>Author</code> is stored as a <code>string</code> in our
database, as a reference to the <code>Author</code>, instead of embedding the <code>Author</code> data 
inside the <code>Book</code>. </p>
<p>Some example JSON data for the two structs looks like:</p>
<p><kbd>GET</kbd> <code>/api/content?type=Author&amp;id=1</code> (<code>Author</code>)</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;data&quot;</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="nt">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;024a5797-e064-4ee0-abe3-415cb6d3ed18&quot;</span><span class="p">,</span>
            <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="nt">&quot;slug&quot;</span><span class="p">:</span> <span class="s2">&quot;item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18&quot;</span><span class="p">,</span>
            <span class="nt">&quot;timestamp&quot;</span><span class="p">:</span> <span class="mi">1493926453826</span><span class="p">,</span>
            <span class="nt">&quot;updated&quot;</span><span class="p">:</span> <span class="mi">1493926453826</span><span class="p">,</span>
            <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Shel Silverstein&quot;</span><span class="p">,</span>
            <span class="nt">&quot;photo&quot;</span><span class="p">:</span> <span class="s2">&quot;/api/uploads/2017/05/shel-silverstein.jpg&quot;</span><span class="p">,</span>
            <span class="nt">&quot;bio&quot;</span><span class="p">:</span> <span class="s2">&quot;Sheldon Allan Silverstein was an American poet...&quot;</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>


<p><kbd>GET</kbd> <code>/api/content?type=Book&amp;id=1</code> (<code>Book</code>)</p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;data&quot;</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="nt">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;024a5797-e064-4ee0-abe3-415cb6d3ed18&quot;</span><span class="p">,</span>
            <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="nt">&quot;slug&quot;</span><span class="p">:</span> <span class="s2">&quot;item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18&quot;</span><span class="p">,</span>
            <span class="nt">&quot;timestamp&quot;</span><span class="p">:</span> <span class="mi">1493926453826</span><span class="p">,</span>
            <span class="nt">&quot;updated&quot;</span><span class="p">:</span> <span class="mi">1493926453826</span><span class="p">,</span>
            <span class="nt">&quot;title&quot;</span><span class="p">:</span> <span class="s2">&quot;The Giving Tree&quot;</span><span class="p">,</span>
            <span class="nt">&quot;author&quot;</span><span class="p">:</span> <span class="s2">&quot;/api/content?type=Author&amp;id=1&quot;</span><span class="p">,</span>
            <span class="nt">&quot;pages&quot;</span><span class="p">:</span> <span class="mi">57</span><span class="p">,</span>
            <span class="nt">&quot;year&quot;</span><span class="p">:</span> <span class="mi">1964</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>


<p>As you can see, the <code>Author</code> is a reference as the <code>author</code> field in the JSON
response for a <code>Book</code>. When you're building your client, you need to make a second
request for the <code>Author</code>, to the URL path found in the <code>author</code> field of the <code>Book</code>
response. </p>
<p>For example, in pseudo-code: </p>
<div class="codehilite"><pre><span></span><span class="c1"># Request 1: </span>
<span class="nv">$book</span> <span class="o">=</span> GET /api/content?type<span class="o">=</span>Book<span class="p">&amp;</span><span class="nv">id</span><span class="o">=</span><span class="m">1</span>

<span class="c1"># Request 2: </span>
<span class="nv">$author</span> <span class="o">=</span> GET <span class="nv">$book</span>.author <span class="c1"># where author = /api/content?type=Author&amp;id=1</span>
</pre></div>


<p>Until recently, this would be considered bad practice and would be costly to do
over HTTP. However, with the wide availability of HTTP/2 clients, including all
modern web browsers, mobile devices, and HTTP/2 libraries in practically every 
programming language, this pattern is fast and scalable. </p>
<hr />
<h3 id="designed-for-http2">Designed For HTTP/2<a class="headerlink" href="#designed-for-http2" title="Permanent link">&para;</a></h3>
<p>At this point, you've likely noticed that you're still making two independent 
HTTP requests to your Ponzu server. Further, if there are multiple references or more
than one item, you'll be making many requests -- <em>how can that be efficient?</em> </p>
<p>There are two main concepts at play: Request/Response Multiplexing and Server Push.</p>
<h4 id="requestresponse-multiplexing">Request/Response Multiplexing<a class="headerlink" href="#requestresponse-multiplexing" title="Permanent link">&para;</a></h4>
<p>With HTTP/2, a client and server (peers) transfer data over a single TCP connection, 
and can send data back and forth at the same time. No longer does a request need
to wait to be sent until after an expected response is read. This means that HTTP 
requests can be sent much faster and at the <em>same time</em> on a single connection. 
Where previously, a client would open up several TCP connections, the re-use of a 
single connection reduces CPU overhead and makes the server more efficient.</p>
<p>This feature is automatically provided to you when using HTTP/2 - the only 
requirement is that you connect via HTTPS and have active TLS certificates, which 
you can get for free by running Ponzu with the <code>--https</code> flag and configuring it 
with a properly set, active domain name of your own. </p>
<h4 id="server-push">Server Push<a class="headerlink" href="#server-push" title="Permanent link">&para;</a></h4>
<p>Another impactful feature of HTTP/2 is "Server Push": the ability to preemptively
send a response from the server to a client without waiting for a request. This
is where Ponzu's reference design really shows it's power. Let's revisit the
example from above:</p>
<div class="codehilite"><pre><span></span><span class="c1"># Request 1: </span>
<span class="nv">$book</span> <span class="o">=</span> GET /api/content?type<span class="o">=</span>Book<span class="p">&amp;</span><span class="nv">id</span><span class="o">=</span><span class="m">1</span>

<span class="c1"># Request 2: </span>
<span class="nv">$author</span> <span class="o">=</span> GET <span class="nv">$book</span>.author <span class="c1"># where author = /api/content?type=Author&amp;id=1</span>
</pre></div>


<p>Instead of waiting for the server to respond with the data for <code>$book.author</code>, 
the response data is already in the client's cache before we even make the request!
Now there is no round-trip made to the server and back, and the client reads the 
pushed response from cache in fractions of a millisecond. </p>
<p>But, how does the server know which response to push and when? You'll need to 
specify which fields of the type you've requested should be pushed. This is done
by implementing the <a href="../../Interfaces/Item#itempushable"><code>item.Pushable</code> interface</a>. 
See the example below which demonstrates a complete implementation on the <code>Book</code>
struct, which has a reference to an <code>Author</code>.</p>
<h5 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h5>
<p><code>content/book.go</code></p>
<div class="codehilite"><pre><span></span><span class="o">...</span>
<span class="kd">type</span> <span class="nx">Book</span> <span class="kd">struct</span> <span class="p">{</span>
    <span class="nx">item</span><span class="p">.</span><span class="nx">Item</span>

    <span class="nx">Title</span>  <span class="kt">string</span> <span class="s">`json:&quot;title&quot;`</span>
    <span class="nx">Author</span> <span class="kt">string</span> <span class="s">`json:&quot;author&quot;`</span>
    <span class="nx">Pages</span>  <span class="kt">int</span>    <span class="s">`json:&quot;pages&quot;`</span>
    <span class="nx">Year</span>   <span class="kt">int</span>    <span class="s">`json:&quot;year&quot;`</span>
<span class="p">}</span>


<span class="kd">func</span> <span class="p">(</span><span class="nx">b</span> <span class="o">*</span><span class="nx">Book</span><span class="p">)</span> <span class="nx">Push</span><span class="p">()</span> <span class="p">[]</span><span class="kt">string</span> <span class="p">{</span>
    <span class="k">return</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span>
        <span class="c1">// the json struct tag is used to tell the server which</span>
        <span class="c1">// field(s) it should push - only URL paths originating</span>
        <span class="c1">// from your server can be pushed!</span>
        <span class="s">&quot;author&quot;</span><span class="p">,</span> 
    <span class="p">}</span>
<span class="p">}</span>
<span class="o">...</span>
</pre></div>


<p>Now, whenever a single <code>Book</code> is requested, the server will preemptively push the
<code>Author</code> referenced by the book. The response for the <code>Author</code> will <em>already be
on the client</em> and will remain there until a request for the referenced <code>Author</code> 
has been made.</p>
<div class="admonition note">
<p class="admonition-title">What else can I Push?</p>
<p>Only fields that are URL paths originating from your server can be pushed. 
This means that you could also implement <code>item.Pushable</code> on the <code>Author</code>
type, and return <code>[]string{"photo"}</code> to push the Author's image!</p>
</div>
<hr />
<h3 id="other-considerations">Other Considerations<a class="headerlink" href="#other-considerations" title="Permanent link">&para;</a></h3>
<p>HTTP/2 Server Push is a powerful feature, but it can be abused just like anything
else. To try and help mitigate potential issues, Ponzu has put some "stop-gaps"
in place. Server Push is only activated on <strong>single item</strong> API responses, so you
shouldn't expect to see references or files pushed from the <code>/api/contents</code> endpoint.
An exception to this is the <code>/api/search</code> endpoint, which only the <strong>first</strong> 
result is pushed (if applicable) no matter how many items are in the response. </p>
<p>You should take advantage of HTTP/2 in Ponzu and get the most out of the system. 
With the automatic HTTPS feature, there is no reason not to and you gain the 
additional benefit of encrypting your traffic - which your users will appreciate!</p>
                
                  
                
              
              
                
              
            </article>
          </div>
        </div>
      </main>
      
        
<footer class="md-footer">
  
    <div class="md-footer-nav">
      <nav class="md-footer-nav__inner md-grid">
        
          <a href="../../Quickstart/Overview/" title="Overview" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
            </div>
            <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  Previous
                </span>
                Overview
              </span>
            </div>
          </a>
        
        
          <a href="../../Running-Backups/Backups/" title="Backups" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
            <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  Next
                </span>
                Backups
              </span>
            </div>
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
            </div>
          </a>
        
      </nav>
    </div>
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-footer-copyright">
        
        powered by
        <a href="http://www.mkdocs.org" title="MkDocs">MkDocs</a>
        and
        <a href="http://squidfunk.github.io/mkdocs-material/" title="Material for MkDocs">
          Material for MkDocs</a>
      </div>
      
        
  <div class="md-footer-social">
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    
      <a href="https://github.com/ponzu-cms" class="md-footer-social__link fa fa-github"></a>
    
      <a href="https://twitter.com/ponzu_cms" class="md-footer-social__link fa fa-twitter"></a>
    
  </div>

      
    </div>
  </div>
</footer>
      
    </div>
    
      <script src="../../assets/javascripts/application-6b599127bc.js"></script>
      <script>app.initialize({url:{base:"../.."}})</script>
      
    
    
      
      <script>!function(e,t,a,n,o,c,i){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,c=t.createElement(a),i=t.getElementsByTagName(a)[0],c.async=1,c.src=n,i.parentNode.insertBefore(c,i)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create","UA-98609560-1","auto"),ga("set","anonymizeIp",!0),ga("send","pageview");var links=document.getElementsByTagName("a");Array.prototype.map.call(links,function(e){e.host!=document.location.host&&e.addEventListener("click",function(){var t=e.getAttribute("data-md-action")||"follow";ga("send","event","outbound",t,e.href)})});var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})</script>
      
    
  </body>
</html>