|
| makeHttpRequest ($url, $method, $headers, $body=null) |
|
| getOAuthTokenHeader ($scopes) |
|
| getRangeHeader ($start_byte, $end_byte) |
|
| makeHttpRequest ($url, $method, $headers, $body=null) |
|
| getHeaderValue ($header_name, $headers) |
|
| createStatArray ($stat_args) |
|
| tryParseCloudStorageErrorMessage ($gcs_result, &$code, &$message) |
|
| getErrorMessage ($http_status_code, $http_result, $msg_prefix="Cloud Storage Error:") |
|
|
static | createObjectUrl ($bucket, $object=null) |
|
const | METADATA_HEADER_PREFIX = 'x-goog-meta-' |
|
const | DEFAULT_READ_SIZE = 524288 |
|
const | DEFAULT_READ_CACHE_EXPIRY_SECONDS = 3600 |
|
const | DEFAULT_MAXIMUM_NUMBER_OF_RETRIES = 2 |
|
const | DEFAULT_WRITABLE_CACHE_EXPIRY_SECONDS = 600 |
|
const | READ_SCOPE = "https://www.googleapis.com/auth/devstorage.read_only" |
|
const | WRITE_SCOPE = "https://www.googleapis.com/auth/devstorage.read_write" |
|
const | FULL_SCOPE = "https://www.googleapis.com/auth/devstorage.full_control" |
|
const | OAUTH_TOKEN_FORMAT = "OAuth %s" |
|
const | PARTIAL_CONTENT_RANGE_FORMAT = "bytes %d-%d/*" |
|
const | FINAL_CONTENT_RANGE_FORMAT = "bytes %d-%d/%d" |
|
const | FINAL_CONTENT_RANGE_NO_DATA = "bytes */%d" |
|
const | DELIMITER = '/' |
|
const | FOLDER_SUFFIX = '_$folder$' |
|
const | WRITABLE_TEMP_FILENAME = "/_ah_is_writable_temp_file" |
|
const | S_IFREG = 0100000 |
|
const | S_IFDIR = 0040000 |
|
const | S_IRWXU = 00700 |
|
const | S_IRUSR = 00400 |
|
const | S_IWUSR = 00200 |
|
const | S_IXUSR = 00100 |
|
const | S_IRWXG = 00070 |
|
const | S_IRGRP = 00040 |
|
const | S_IWGRP = 00020 |
|
const | S_IXGRP = 00010 |
|
const | S_IRWXO = 00007 |
|
const | S_IROTH = 00004 |
|
const | S_IWOTH = 00002 |
|
const | S_IXOTH = 00001 |
|
const | CONTENT_RANGE_REGEX = "/bytes\s+(\d+)-(\d+)\/(\d+)/i" |
|
const | MEMCACHE_KEY_FORMAT = "_ah_gs_read_cache_%s_%s" |
|
const | WRITABLE_MEMCACHE_KEY_FORMAT = "_ah_gs_write_bucket_cache_%s" |
|
static | POST |
|
static | enable_optimistic_cache |
|
static | extractMetaData (array $headers) |
|
| $bucket_name |
|
| $object_name |
|
| $context_options = [] |
|
| $url |
|
| $anonymous |
|
static | $METADATA_HEADERS |
|
static | $retry_error_codes |
|
static | $retry_exception_codes |
|
static | $valid_acl_values |
|
static | $upload_start_header = ["x-goog-resumable" => "start"] |
|
Google Cloud Storage Client for reading objects.
google\appengine\ext\cloud_storage_streams\CloudStorageReadClient::makeHttpRequest |
( |
|
$url, |
|
|
|
$method, |
|
|
|
$headers, |
|
|
|
$body = null |
|
) |
| |
|
protected |
Override the makeHttpRequest function so we can implement caching. If caching is enabled then we try and retrieve a matching request for the object name and range from memcache. If we find a result in memcache, and optimistic caching is enabled then we return that result immediately without checking if the object has changed in GCS. Otherwise, we will issue a 'If-None-Match' request with the ETag of the object to ensure it is still current.
Optimisitic caching is best suited when the application is soley updating objects in cloud storage, as the cache can be invalidated when the object is updated by the application.