I accidentally replied to Itsu directly instead of posting to the group... Take a look at:
http://code.google.com/p/urlrewritefilter/ He replied that this doesn't work for .html files, which is true and makes sense because requests for static html files are probably never hitting the servlet engine. If you want to add headers to requests for static files they can't be static.. you can still have appengine treat them as such in terms of caching upstream by using urls that are routed to the urlrewritefilter in web.xml by path and then adding cache headers (along with whatever other headers you want included) and forwarding the request to a jsp page or servlet to generate the response. We use this technique frequently to add cache and custom headers to files served out of the blobstore as well as to cache REST requests served via Jersey. For example, this should be understandable to anyone who has done any work with the blobstore... <rule> <from>/media/serve/(.*)/stream.mp3</from> <set type="response-header" name="Cache-Control">public, max- age=86400</set> <set type="expires">24 hours</set> <to last="true">/serve?blob-key=$1</to> </rule> On Feb 11, 1:15 am, Itsu Tamam <[email protected]> wrote: > I'd like to add a custom header to all HTML files served from my app. > > I'm looking for a configuration option in appengine-web.xml > (http://code.google.com/appengine/docs/java/config/appconfig.html) > or web.xml (http://code.google.com/appengine/docs/java/config/webxml.html), > but could not found any. - Maybe I'm missing something in the documentation? > > Wrapping our HTML's in JSP (or any other server side HTML generation > technology) is not a good solution for us - we want our HTML files to be > cached in the front-ends. > > We need this in order to set a X-FRAME-OPTIONS header. > > Help will be really appreciated. > > Thanks! -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
