Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Created March 13, 2011 06:51
Show Gist options
  • Select an option

  • Save dustingetz/867934 to your computer and use it in GitHub Desktop.

Select an option

Save dustingetz/867934 to your computer and use it in GitHub Desktop.
{
"events": [
{
"type": "WAVELET_SELF_ADDED",
"modifiedBy": "dustin.getz@googlewave.com",
"timestamp": 1299396504221,
"properties": {
"blipId": "b+L1Y00ipBB"
}
}
],
"wavelet": {
"creationTime": 1299388899706,
"lastModifiedTime": 1299396504221,
"version": 5208,
"participants": [
"dustin.getz@googlewave.com",
"dustin-getz@appspot.com"
],
"participantRoles": {
"dustin-getz@appspot.com": "FULL",
"dustin.getz@googlewave.com": "FULL"
},
"dataDocuments": {
},
"tags": [
],
"creator": "dustin.getz@googlewave.com",
"rootBlipId": "b+L1Y00ipBB",
"title": "I have a blog serving static content from a database, how can i make it faster?",
"waveId": "googlewave.com!w+L1Y00ipBA",
"waveletId": "googlewave.com!conv+root",
"rootThread": {
"id": "",
"location": -1,
"blipIds": [
"b+L1Y00ipBB"
]
}
},
"blips": {
"b+L1Y00ipBB": {
"annotations": [
{
"name": "conv/title",
"value": "",
"range": {
"start": 0,
"end": 80
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 0,
"end": 80
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 81,
"end": 480
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 481,
"end": 580
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 482,
"end": 506
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 581,
"end": 913
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 582,
"end": 606
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHH\nf\nmemcache",
"range": {
"start": 593,
"end": 601
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNGr\nf\npost",
"range": {
"start": 626,
"end": 630
}
},
{
"name": "lang",
"value": "unknown",
"range": {
"start": 914,
"end": 945
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 915,
"end": 946
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 945,
"end": 1077
}
},
{
"name": "link/manual",
"value": "http://jimplush.com/blog/article/179/What-happens-when-you-are-the--number-1-article-on-Hacker-News",
"range": {
"start": 1021,
"end": 1029
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHT\nf\nHN",
"range": {
"start": 1074,
"end": 1076
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 1078,
"end": 1789
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 1079,
"end": 1105
}
},
{
"name": "style/color",
"value": "rgb(0, 62, 168)",
"range": {
"start": 1204,
"end": 1219
}
},
{
"name": "style/fontFamily",
"value": "arial, sans-serif",
"range": {
"start": 1204,
"end": 1219
}
},
{
"name": "link/manual",
"value": "http://www.google.com/url?sa\u003dD\u0026q\u003dhttp%3A%2F%2Fdavedash.com%2F2009%2F03%2F08%2Fappengine-is-not-a-free-cdn%2F",
"range": {
"start": 1204,
"end": 1219
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHW\nf\nCDN",
"range": {
"start": 1357,
"end": 1360
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHb\nf\nCDN",
"range": {
"start": 1499,
"end": 1502
}
},
{
"name": "link/auto",
"value": "http://a3.phobos.ak.fbcdn.net/hphotos-ak-snc6/168376_680495569322_6103645_38357296_5905348_n.jpg?dl\u003d1",
"range": {
"start": 1631,
"end": 1732
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHg\nu\nphobos",
"range": {
"start": 1641,
"end": 1647
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHh\nf\nsnc6",
"range": {
"start": 1672,
"end": 1676
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 1790,
"end": 1948
}
},
{
"name": "link/auto",
"value": "http://blog.dustingetz.com",
"range": {
"start": 1837,
"end": 1856
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHi\nf\ndustingetz",
"range": {
"start": 1842,
"end": 1852
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 1949,
"end": 2135
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 1950,
"end": 1973
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHU\nf\nCloudFront",
"range": {
"start": 1957,
"end": 1967
}
},
{
"name": "link/manual",
"value": "http://aws.amazon.com/cloudfront/",
"range": {
"start": 1974,
"end": 1991
}
},
{
"name": "link/manual",
"value": "http://coderjournal.com/2010/12/setting-up-a-cloudfront-mirroring-cdn-in-5-minutes/",
"range": {
"start": 2034,
"end": 2067
}
},
{
"name": "link/manual",
"value": "http://coderjournal.com/2010/12/setting-up-a-cloudfront-mirroring-cdn-in-5-minutes/",
"range": {
"start": 2136,
"end": 2137
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 2136,
"end": 2491
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 2137,
"end": 2160
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNG8\nf\nS3",
"range": {
"start": 2160,
"end": 2162
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNG9\nf\nbandwdith",
"range": {
"start": 2177,
"end": 2186
}
},
{
"name": "link/manual",
"value": "http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html",
"range": {
"start": 2300,
"end": 2352
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNHA\nf\nS3",
"range": {
"start": 2300,
"end": 2302
}
},
{
"name": "link/manual",
"value": "http://coderjournal.com/2010/12/setting-up-a-cloudfront-mirroring-cdn-in-5-minutes/",
"range": {
"start": 2491,
"end": 2493
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 2492,
"end": 2882
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 2493,
"end": 2517
}
},
{
"name": "lang",
"value": "ru",
"range": {
"start": 2883,
"end": 2889
}
},
{
"name": "style/fontWeight",
"value": "bold",
"range": {
"start": 2884,
"end": 2889
}
},
{
"name": "lang",
"value": "en",
"range": {
"start": 2889,
"end": 3202
}
},
{
"name": "spell",
"value": "sp+gnBV1bZkNH2\nf\nlet",
"range": {
"start": 2949,
"end": 2952
}
},
{
"name": "link/manual",
"value": "http://radomirml.com/2011/01/30/reverse-proxy-for-gae-application-using-nginx-and-ssl",
"range": {
"start": 3128,
"end": 3162
}
}
],
"elements": {
"0": {
"type": "LINE",
"properties": {
}
},
"1973": {
"type": "LINE",
"properties": {
}
},
"2135": {
"type": "LINE",
"properties": {
}
},
"945": {
"type": "LINE",
"properties": {
}
},
"2136": {
"type": "LINE",
"properties": {
}
},
"81": {
"type": "LINE",
"properties": {
}
},
"80": {
"type": "LINE",
"properties": {
}
},
"2516": {
"type": "LINE",
"properties": {
}
},
"1790": {
"type": "LINE",
"properties": {
}
},
"1104": {
"type": "LINE",
"properties": {
}
},
"1789": {
"type": "LINE",
"properties": {
}
},
"2882": {
"type": "LINE",
"properties": {
}
},
"2883": {
"type": "LINE",
"properties": {
}
},
"580": {
"type": "LINE",
"properties": {
}
},
"581": {
"type": "LINE",
"properties": {
}
},
"506": {
"type": "LINE",
"properties": {
}
},
"1948": {
"type": "LINE",
"properties": {
}
},
"2889": {
"type": "LINE",
"properties": {
}
},
"1949": {
"type": "LINE",
"properties": {
}
},
"914": {
"type": "LINE",
"properties": {
}
},
"913": {
"type": "LINE",
"properties": {
}
},
"2491": {
"type": "LINE",
"properties": {
}
},
"2492": {
"type": "LINE",
"properties": {
}
},
"2159": {
"type": "LINE",
"properties": {
}
},
"605": {
"type": "LINE",
"properties": {
}
},
"481": {
"type": "LINE",
"properties": {
}
},
"480": {
"type": "LINE",
"properties": {
}
},
"1078": {
"type": "LINE",
"properties": {
}
},
"1077": {
"type": "LINE",
"properties": {
}
}
},
"blipId": "b+L1Y00ipBB",
"childBlipIds": [
],
"contributors": [
"dustin.getz@googlewave.com"
],
"creator": "dustin.getz@googlewave.com",
"content": "\nI have a blog serving static content from a database, how can i make it faster?\n\nI am rolling my own blog engine hosted on Google App Engine. Rendered blog posts are stored and served straight from the datastore. I want to implement some sort of caching architecture on principle, as a learning experience, so there is zero datastore load to serve static HTML. This saves me money (CPU cycles) if I get slashdotted. Not necessarily latency, as the datastore is designed to scale.\n\nApp Engine blobstore API\nthis is a custom datastore which is optimized for high-performance reads.\n\nApp Engine memcache API\nServe each rendered post from memcache (part of the appengine API). That was too easy, so let\u0027s look at our other options. The memcache is shared application wide, so its not any closer to users. Its also \"unreliable\" in that data may be cleared from cache at any time, but who cares, it won\u0027t happen a lot.\n\nIn-memory databases like Redis\nThey\u0027re diskless and fast so they can be used to implement a cache server. this guy used Redis to cache stuff when he hit #1 on HN.\n\nContent Delivery Networks\n\"A CDN is a system which sends data to a user using nearby servers, rather than a central server.\" cite: Dave Dash This means the big files don\u0027t have to travel as far. This does the caching we need and more. If our entire blog is static, we can put a CDN in front of it and be golden. If parts of the blog are dynamic, the static portions would have to be served from another hostname, so the CDN can buffer only the static host. This example Facebook image resource shows that static resources are served from another host: http://a3.phobos.ak.fbcdn.net/hphotos-ak-snc6/168376_680495569322_6103645_38357296_5905348_n.jpg?dl\u003d1. It\u0027s hard (more expensive) to delete things from a CDN.\n\nThis is a great answer. I can use DNS to map \"blog.dustingetz.com\"
(cut off)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment