Apache .htaccess cache settings

             

RewriteEngine On RewriteBase / RewriteCond %{ENV:HTTPS} !^.*on RewriteRule ^(.*)$ https://yourdomain.com/$1 [R,L] # One year for image files <filesMatch ".(jpg|jpeg|png|gif|ico)$"> Header set Cache-Control "max-age=31536000, public" </filesMatch> # One month for css and js <filesMatch ".(css|js)$"> Header set Cache-Control "max-age=2628000, public" </filesMatch> # 480 weeks <filesMatch "\.(eot|svg|ttf|woff|woff2)$"> Header set Cache-Control "max-age=1209600, public" </filesMatch>


Apache redirect HTTP na HTTPS

             

Do sekce pro virtualhost port 80 () přidejte: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


Git prune local branches

             

git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done


JSON server

             

Pro rychlé rozběhnutí aplikace s uložištěm dat v objektově orientované databázi není nutné zakládat objekty přímo v DB. Pro rychlý mock server lze využít package JSON server. JSON server drží data v souboru ve formátu JSON. npm install -D json-server Zdroj a více informací https://scotch.io/tutorials/json-server-as-a-fake-rest-api-in-frontend-development