I have an app.yaml file at the same level as my python application main file. I think adding a handler in app.yaml that can config the expiration time for static folder. How can I do the same thing in google flexible engine?
handlers:
- url: /images
static_dir: static/*
expiration: "4d 5h"
In the flex environment the app.yaml
file has no support for such handlers element specification.
If you're serving the static files through your application you need to check the specific intructions for the framework you're using.
If you're serving the static files from Cloud Storage see Setting cache parameters:
You can control how or if your website assets are cached by configuring cache control headers. Generally, only set cache control headers for objects that are accessible to all anonymous users, which is a requirement for any object served from a Cloud Storage bucket as part of a static website.
Google Cloud Storage applies a cache control setting of 3600 seconds to objects that are accessible to all anonymous users, unless you specify explicit cache control settings. For examples, see the metadata page of
gsutil
, the setting object metadata page for the Google Cloud Platform Console, or headers reference pages for XML and JSON.