Slide 1

Slide 1 text

@seanyo seanyo.ca [email protected] Web Server With a Side of Includes

Slide 2

Slide 2 text

@seanyo seanyo.ca [email protected] Get ready cuz We’re

Slide 3

Slide 3 text

@seanyo seanyo.ca [email protected] WTF is SSI?

Slide 4

Slide 4 text

@seanyo seanyo.ca [email protected] Server Side Includes Code like it’s 1999

Slide 5

Slide 5 text

@seanyo seanyo.ca [email protected] a simple interpreted server-side scripting language for the Web. Reintroducing Apache SSI Turing Complete First introduced in 1997 in NCSA httpd Wrapped in HTML comment markup

Slide 6

Slide 6 text

@seanyo seanyo.ca [email protected] THE MANY FORMS OF SSI And I’ll Form The Header!

Slide 7

Slide 7 text

@seanyo seanyo.ca [email protected] SSI Features Element Description config configure output formats echo print variables exec execute external programs fsize print size of a file flastmod print last modification time of a file include include a file printenv print all available variables set set a value of a variable

Slide 8

Slide 8 text

@seanyo seanyo.ca [email protected]

Slide 9

Slide 9 text

@seanyo seanyo.ca [email protected] SET UP US THE INCLUDE! All Your Apache Are Belong To Us

Slide 10

Slide 10 text

@seanyo seanyo.ca [email protected]
. . .
Show Me The Code!

Slide 11

Slide 11 text

@seanyo seanyo.ca [email protected]

Slide 12

Slide 12 text

@seanyo seanyo.ca [email protected] APACHE THE GIANT Well, you see, you use different moves when you're coding with half a dozen tools than when you only have to be worried about…one.

Slide 13

Slide 13 text

@seanyo seanyo.ca [email protected] Nothing to install. Just start coding. Apache a la Carte

Slide 14

Slide 14 text

@seanyo seanyo.ca [email protected] I PITY THE UNCACHED! Maybe, Mr. T's pretty handy with computers!

Slide 15

Slide 15 text

@seanyo seanyo.ca [email protected] This can give SSI a A bit of a performance boost SSI: Cache-ibly Delicious

Slide 16

Slide 16 text

@seanyo seanyo.ca [email protected] THE XBIT HACK Yo Dawg. I heard you like includes on your website, so I put some includes in your includes so you can include them while you code

Slide 17

Slide 17 text

@seanyo seanyo.ca [email protected] Xbit Full FTW Respects Group X Sets Expire to Including File Xzibit Your Code

Slide 18

Slide 18 text

@seanyo seanyo.ca [email protected] CODE FORCE SSI Chuck Norris doesn’t use web standards… They use him.

Slide 19

Slide 19 text

@seanyo seanyo.ca [email protected] All the fun…none of risk? IncludesNoExec SSILand Security

Slide 20

Slide 20 text

@seanyo seanyo.ca [email protected] WHO WINS THE RACE? SSI vs PHP

Slide 21

Slide 21 text

@seanyo seanyo.ca [email protected] About The Same… GO GO Code Racer! *** HTML & CSS *** > ab ‐n 25000 ‐c 10 http://sean.dreamhosters.com/pets This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking sean.dreamhosters.com (be patient) Completed 2500 requests Completed 5000 requests Completed 7500 requests Completed 10000 requests Completed 12500 requests Completed 15000 requests Completed 17500 requests Completed 20000 requests Completed 22500 requests Completed 25000 requests Finished 25000 requests Server Software: Apache Server Hostname: sean.dreamhosters.com Server Port: 80 Document Path: /pets Document Length: 242 bytes Concurrency Level: 10 Time taken for tests: 11.961 seconds Complete requests: 25000 Failed requests: 608 (Connect: 0, Receive: 0, Length: 608, Exceptions: 0) Write errors: 0 Non‐2xx responses: 25000 Total transferred: 12104792 bytes HTML transferred: 6099248 bytes Requests per second: 2090.15 [#/sec] (mean) Time per request: 4.784 [ms] (mean) Time per request: 0.478 [ms] (mean, across all concurrent requests) Transfer rate: 988.32 [Kbytes/sec] received Connection Times (ms) min mean[+/‐sd] median max Connect: 0 1 1.6 1 38 Processing: 0 3 39.1 1 978 Waiting: 0 3 39.1 1 978 Total: 1 5 39.2 2 978 Percentage of the requests served within a certain time (ms) 50% 2 66% 2 75% 3 80% 4 90% 4 95% 5 98% 12 99% 19 100% 978 (longest request) *** With SSI, XBitHack Full *** ab ‐n 25000 ‐c 10 http://sean.dreamhosters.com/pets This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking sean.dreamhosters.com (be patient) Completed 2500 requests Completed 5000 requests Completed 7500 requests Completed 10000 requests Completed 12500 requests Completed 15000 requests Completed 17500 requests Completed 20000 requests Completed 22500 requests Completed 25000 requests Finished 25000 requests Server Software: Apache Server Hostname: sean.dreamhosters.com Server Port: 80 Document Path: /pets Document Length: 242 bytes Concurrency Level: 10 Time taken for tests: 12.838 seconds Complete requests: 25000 Failed requests: 771 (Connect: 0, Receive: 0, Length: 771, Exceptions: 0) Write errors: 0 Non‐2xx responses: 25000 Total transferred: 12112779 bytes HTML transferred: 6112451 bytes Requests per second: 1947.37 [#/sec] (mean) Time per request: 5.135 [ms] (mean) Time per request: 0.514 [ms] (mean, across all concurrent requests) Transfer rate: 921.41 [Kbytes/sec] received Connection Times (ms) min mean[+/‐sd] median max Connect: 0 1 1.3 1 42 Processing: 0 4 43.3 1 982 Waiting: 0 4 43.3 1 982 Total: 0 5 43.3 2 982 Percentage of the requests served within a certain time (ms) 50% 2 66% 2 75% 2 80% 3 90% 4 95% 4 98% 9 99% 15 100% 982 (longest request)

Slide 22

Slide 22 text

@seanyo seanyo.ca [email protected] WHEN NOT TO USE SSI… If My Website Only Had a Brain

Slide 23

Slide 23 text

@seanyo seanyo.ca [email protected] If you’re using PHP only for includes…think about SSI Data Base Jumping

Slide 24

Slide 24 text

@seanyo seanyo.ca [email protected] Server Side Includes Code like it’s 1999