{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/641","labels_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/641/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/641/comments","events_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/641/events","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/641","id":92189498,"number":641,"title":"Cache bust EVERYTHING!","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-30T20:18:03Z","updated_at":"2015-06-30T20:37:42Z","closed_at":null,"body":"Cloudfront always seems to give us cached versions of different resources in our app and this causes stale content to be loaded. \r\n\r\nFor e.g. in the \"Your Projects\" page, delete a project (it actually does delete the project) and then refresh the page...you still see the project there (when you try to delete the project again, you get an HTTP 404 because it was actually deleted before).\r\n\r\nThe solution (for now) for this is to send a random query string (probably current datetime) every time we make a request to the server."},"comment":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/comments/117334499","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/641#issuecomment-117334499","issue_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/641","id":117334499,"user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T20:37:42Z","updated_at":"2015-06-30T20:37:42Z","body":"I think this bug likely points at an opportunity for us to solve this higher up the stack.  CC'ing @simonwex and @jbuck for thoughts.\r\n\r\nThe background here is that we're hitting bugs on staging vs. local that relate to Cloudfront caching the responses for dynamic routes.  Obviously having cached resources is ideal, but could we improve things?  A bunch of Thimble is static content, and other bits aren't.  The way Facebook solves this, for example, is to separate things out by domain; so they serve static content from https://fbstatic-a.akamaihd.net/ and let dynamic content go direct to the app server.  Thimble has also changed a lot, with Bramble, since now serve almost all static front-end content from S3 inside an iframe on a second domain vs. serving the editor directly (i.e., Thimble is mostly a bunch of REST routes now, proxying access to publish.webmaker.org).\r\n\r\nIt seems like a bad idea for us to manual break cache for every dynamic route, and I wonder if we'd be better served by isolating our dynamic content (direct to ec2 app) vs. static content (cloudfront is great!)?  Probably there are good recipes for how one does this.\r\n\r\nAs an aside #621 deals with getting the browser to do a better job with cached resources. "}}