title: GAE: Serve CSS file dynamically with correct mime type
body: <p>I am trying to bundle all my CSS files into one in a dynamic way and serve that through my Google app engine. This works if I go to the URL <code>/app.css</code> in the browser:</p>
  
  <pre><code>- url: /app.css
    script: _corecss.php
  </code></pre>
  
  <p>When I plug this into my web page like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;title&gt;My Test App&lt;/title&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="/app.css"&gt;
  ...
  </code></pre>
  
  <p>The console shows an error and no style is applied</p>
  
  <pre><code>Resource interpreted as Stylesheet but transferred with MIME type text/html:
  </code></pre>
  
  <p>When I look in the chrome developer tools, I can see content-length being set, but there is no response data - no idea why, at a guess its something that's realizing I'm not sending CSS to dumps the lot. I do exactly the same thing for my JavaScript and it seems to load fine with the content-type set as text/html.</p>
  
  <p>I googled the error and found that I could set the mime types in the app.yaml:</p>
  
  <pre><code>- url: /app.css
    mime_type: 'text/css'
    script: _corecss.php
  </code></pre>
  
  <p>But this did not work. Further googling suggested that the <code>mime-type</code> directive can only be done on static stuff.</p>
  
  <p>More googleing and I found I should be able to set the headers:</p>
  
  <pre><code>- url: /app.css
    script: _corecss.php
    http_headers:
    Content-Type: text/css
  </code></pre>
  
  <p>This did not work either, and there was mixed info on whether content-type was allowed.</p>
  
  <p>I used to regenerate files on the page load and store them if there were changes, but GAE has stopped access to the file system locally so I can't do this any more.</p>
  
  <p>Any ideas how I can generate my CSS file and serve it so that my application does not complain?</p>
  
  <p>Thanks</p>