Should I move my static resources from App Engine to Google Cloud Storage?

前端 未结 3 2002
清酒与你
清酒与你 2021-02-20 04:25

We have a web application in App Engine. I was wondering whether it is a good idea to move my static resources (i.e Images, CSS files, and JS files) out from App Engine and serv

3条回答
  •  太阳男子
    2021-02-20 05:01

    Your intuition is right, here's the confirmation from Google docs:

    The benefits of using Cloud Storage instead of serving directly from your app include:

    • Cloud Storage essentially works as a content delivery network. This does not require any special configuration because by default any publicly readable object is cached in the global Cloud Storage network.

    • Your app's load will be reduced by offloading serving static assets to Cloud Storage. Depending on how many static assets you have and the frequency of access, this can reduce the cost of running your app by a significant amount.

    • Bandwidth charges for accessing content can often be less with Cloud Storage.

    Know that static files are definitely served using instance resources. It's true that edge cache comes into effect, but this does not simply remove the whole problem. Moving statics to GCS is the right way of doing this.

    Note, however, that if you plan to serve your static files from GCS, you won't be able to properly map a (sub)domain to it over HTTPS (SSL) and you'll have to use a load-balancer or 3rd party CDN. In some cases this may prove to be more of a hassle. See here for details.

提交回复
热议问题