{"id":485,"date":"2008-01-27T20:12:25","date_gmt":"2008-01-28T01:12:25","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/27\/web-design\/"},"modified":"2008-01-27T20:12:25","modified_gmt":"2008-01-28T01:12:25","slug":"web-design","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/27\/web-design\/","title":{"rendered":"Web Design"},"content":{"rendered":"<p>I&#8217;ve redone <a href=\"http:\/\/www.ttwagner.com\/\">ttwagner.com<\/a>. It&#8217;s no longer a random integer between 0 and 255, but instead, a decent-looking site. I&#8217;ve integrated some of the cool things I&#8217;m hosting there as well. I came across a few interesting things I wanted to point out.<\/p>\n<p>The <a href=\"http:\/\/ttwagner.com\/newmain\/root\/\">world DNS page<\/a> is incredibly intensive, and, since it&#8217;s not dynamic, there&#8217;s no sense in &#8220;generating&#8221; it each time. So I used the command <tt>wget <a href=\"http:\/\/localhost\/blah\/index.php\">http:\/\/localhost\/blah\/index.php<\/a> -O index.html<\/tt> to &#8220;download&#8221; the output, and save it as index.html in the web directory. Viola, it serves the HTML file rather than executing the script.<\/p>\n<p>But the HTML output was frankly hideous. The page was written as a, &#8220;You know, I bet I could do&#8230;&#8221; type thing, written to fill some spare time (once upon a time, I had lots of it). So I&#8217;d given no attention to outputting &#8216;readable&#8217; HTML. It was valid code and all, it just didn&#8217;t have linebreaks or anything of the sort, made it a nightmare to read. But I really didn&#8217;t want to rewrite my script to clean up its output so that I could download it again&#8230;.<\/p>\n<p>So I installed <a href=\"http:\/\/tidy.sourceforge.net\/\">tidy<\/a> (which sometimes goes by &#8220;htmltidy,&#8221; including the name of the Gentoo package). A <tt>-m<\/tt> flag tells it to &#8220;modify&#8221; the file in place (as opposed to writing it to standard output). The code looks much cleaner; it&#8217;s not indented, but I can live with that!<\/p>\n<p>I also found that mod_rewrite is useful in ways I hadn&#8217;t envisioned using it before. I developed everything in a subdirectory (\/newmain), and then just used an htaccess override to make it &#8220;look&#8221; like the main page (at ttwagner.com\/ ). This simplifies things greatly, as it would complicate my existing directory structure. (It&#8217;s imperfect: you &#8220;end up&#8221; in \/newmain anyway, but my goal isn&#8217;t to &#8220;hide&#8221; that directory, just to make the main page not blank.)<\/p>\n<p>I&#8217;ve also found <a href=\"http:\/\/www.ilovejackdaniels.com\/php\/php-gzip-and-htaccess\/\">I Like Jack Daniel&#8217;s<\/a>. (Potential future employers: note the missing &#8220;that&#8221; in that sentence, which changes the meaning completely!) The site is a brilliant compendium of useful information, focusing on, well, Apache, PHP, MySQL, and gzip, generally. The &#8220;world DNS&#8221; page was quite large, so I decided to start using gzip compression. He lists a quick, simple, and surefire way to get it working. (The one downside, and it&#8217;s really a fundamental &#8216;flaw&#8217; with compression in general, is that you can&#8217;t draw the page until the whole transfer is complete. This has an interesting effect as you wait for the page to load: it just sits there not doing much of anything, and then, in an instant, displays the whole page.) It may be possible to flush the &#8216;cache&#8217; more often, resulting in &#8220;progressive&#8221; page loading, but this would be complicated, introduce overhead, and, if done enough to be noticeable, also defeat the point of compression. (Extreme example: Imagine taking a text file, splitting it into lots and lots of one-byte files, and then compressing each of them individually. Net compression: 0. Net overhead: massive!)<\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve redone ttwagner.com. It&#8217;s no longer a random integer between 0 and 255, but instead, a decent-looking site. I&#8217;ve integrated some of the cool things I&#8217;m hosting there as well. I came across a few interesting things I wanted to &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/27\/web-design\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,13,15,18,19,22,24],"tags":[],"class_list":["post-485","post","type-post","status-publish","format-standard","hentry","category-computers","category-cool-links","category-linux-tips","category-living","category-ocd","category-performance","category-programming","category-rants-raves"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}