Skip to content

Instantly share code, notes, and snippets.

@rolandstarke
rolandstarke / Nginx FastCGI Cache.md
Last active June 16, 2022 08:53
Serve Laravel from the Nginx cache

Nginx FastCGI Cache with Laravel

Serve dynamicaly generated files from Laravel from the Nginx cache.

Nginx config

docs

# sudo nano /etc/nginx/sites-available/default
@rolandstarke
rolandstarke / README.md
Last active March 28, 2024 22:21
Faster Laravel File Cache Garbage Collector

Laravel File Cache Garbage Collector

Command to delete old expired cache files.

When using the file cache driver, Laravel creates the cache files but never purges expired ones. This can lead to a situation where you have a large number of unused and irrelevant cache files, especially if you do a lot of short-term caching in your system.

Install

@rolandstarke
rolandstarke / README.md
Last active March 8, 2023 20:07
Laravel less cookies in response

Laravel less Cookies in Response

Laravel sends the session and csrf cookie in every response. That is additional trafic that's not needed. With this changes the session cookie and csrf cookie don't get resend to the client every time if they did not change (but at least once an hour to prevent client side expiring).

@rolandstarke
rolandstarke / laravel setup.sh
Last active April 2, 2024 20:42
Server setup bash script for Laravel
# Ubuntu 20 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update