firevel/firestore-cache-driver

适用于在Google App Engine中运行的Laravel应用程序的Firestore缓存驱动程序。

1.1.0 2023-08-15 20:44 UTC

This package is auto-updated.

Last update: 2024-09-15 23:47:58 UTC


README

适用于在App Engine标准环境中运行的Laravel/Firevel应用程序的缓存驱动程序。

安装

composer require firevel/firestore-cache-driver

将firestore驱动程序添加到config/cache.php

    'stores' => [
    	...
        'firestore' => [
            'driver' => 'firestore',
            'collection' => 'cache', // Firestore collection name.
        ],
        ...
   ];

在.env中设置 CACHE_DRIVER=firestore

重要通知

驱动程序基于Laravel 5.8+开发,其中TTL以秒为单位计算,而不是分钟。

限制

  • 最新的限制 https://cloud.google.com/firestore/quotas
  • 文档的最大大小为1MB,因此请保持缓存值较小。
  • 对文档的最大写入速率为每秒1次(在实际操作中可能更高)。这可能会影响基于快速值增加的功能(例如api节流)。
  • Firestore可以一次删除一个文档,因此像flush()这样的操作可能会花费一些时间。