{"repo":"yediyuz/laravel-cloudflare-cache","free":true,"listed":false,"github":"https://github.com/yediyuz/laravel-cloudflare-cache","clone":"git clone https://github.com/yediyuz/laravel-cloudflare-cache.git","description":"Serve millions of requests by caching with Cloudflare","language":"PHP","stars":282,"topics":["cache","cloudflare","cloudflare-cache","laravel","yediyuz"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Cloudflare Cache You can serve millions of requests with this package. This package provides cacheable routes for Cloudflare. Thanks to Cloudflare, your static pages are served efficiently, reducing the load on your servers if they are cached for the TTL (Time to Live) duration. You can purge the cache whenever you need with this package. Installation You can install the package via composer: You can publish the config file with: Add environment variables to .env file Using global api key: Using fine-grained api token: Add Rule on Cloudflare To active caching on static pages, you need to add page rule OR cache rule on Cloudflare. For page rule: - If the URL matches: www.example.com/ - Setting: Cache Level - Value: Cache Everything For the cache rule: - Field: hostname - Operator: equals - Value: example.com - Then: Eligible for cache https://developers.cloudflare.com/cache/how-to/cache-rules/create-dashboard/ Usage Define routes to cache You can use cache groups for your static contents. You can use cache tags, so you can clear your caches easily. Specify custom ttl for expire time in seconds. When you do not pass ttl, it will use default ttl given in the config. [!WARNING] Be careful caching your routes! Do not cache your dynamic pages such as admin panel or form based pages! Clear Cache Purges everything https://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/ Purges by urls https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-sing","default_branch":null,"files":null,"tree":[],"storefront":"/r/yediyuz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/yediyuz/laravel-cloudflare-cache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}