File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,11 @@ function scopeDemo(ServerRequestInterface $request): string
3333{
3434 // Heavy computations should be cached between invocations.
3535 // The PHP runtime does NOT preserve variables between invocations, so we
36- // must write their values to a file.
37- // (All writable directories in Cloud Functions are in-memory, so these
38- // operations are typically fast.)
36+ // must write their values to a file or otherwise cache them.
37+ // (All writable directories in Cloud Functions are in-memory, so
38+ // file-based caching operations are typically fast.)
39+ // You can also use PSR-6 caching libraries for this task:
40+ // https://packagist.org/providers/psr/cache-implementation
3941 $ cachePath = sys_get_temp_dir () . '/cached_value.txt ' ;
4042
4143 if (file_exists ($ cachePath )) {
You can’t perform that action at this time.
0 commit comments