Allow AJAX GETs from Amazon S3? (Access-Control-Allow-Origin)

后端 未结 11 1864
灰色年华
灰色年华 2020-12-23 16:34

I\'m storing JSON objects in Amazon S3, and I\'d like to load that data directly from S3 from Javascript. My GET looks pretty generic:

$.ajax({
    \'type\':         


        
11条回答
  •  别那么骄傲
    2020-12-23 17:27

    You may want to increase the MAX AGE configuration if you have larger files that will take longer to download, or they may cut off early. Media hosting etc will need this. My config for wildcard access (any domain) was 10000 seconds max, which should be safely longer than anyone needs to download my files even on a bad connection:

    
    
    
        *
        GET
        HEAD
        10000
        *
    
    
    

提交回复
热议问题