vmod workshop
-
Upload
varnish-software -
Category
Technology
-
view
181 -
download
1
Transcript of vmod workshop
![Page 1: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/1.jpg)
![Page 2: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/2.jpg)
WRITINGVMODS
![Page 3: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/3.jpg)
Arianna Aondio
Field Engineer
WHO AM I?
● Email: [email protected]● Twitter: aondio_● Github: aondio
![Page 4: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/4.jpg)
AGENDA
● Varnishd -C
● Inline c
● VCC file
● Demo
![Page 5: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/5.jpg)
Fun fact:I’m a new OS X user.It took me 10 minutes of googlingto understand how to type this → “\”with this new keyboard.
Be nice to me!
![Page 6: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/6.jpg)
VARNISHD -C
There is no VCL magic
Try it out with:varnishd -C -f your/vcl/file
![Page 7: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/7.jpg)
INLINE C-CODE
Can do almost anything...
C{printf(”Arianna doesn’t like inline c!\n”);
}C
...but VMODs are better!
![Page 8: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/8.jpg)
VCC FILE
Interface between VMOD andthe VCL runtime ("VRT")
And…the man page isgenerated from it!
![Page 9: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/9.jpg)
BUILDING A VMOD
● Fork libvmod-examle https://github.com/varnish/libvmod-example.git
● Run rename-vmod-script
● ./autogen
● ./configure
● Make
● Make check
● Make install
![Page 10: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/10.jpg)
DEMO
Some coding...
![Page 11: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/11.jpg)
WORKSPACE
![Page 12: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/12.jpg)
WORKFLOW
![Page 13: vmod workshop](https://reader031.fdocuments.us/reader031/viewer/2022030307/58e8cc8b1a28abb3398b4e4f/html5/thumbnails/13.jpg)
THANK YOU