라라벨 캐시 사용하기
스팸단어 체크등에 캐시 사용use Illuminate\Support\Facades\Cache;$spam_words = Cache::remember('spam_words', 600, function () { return DB::table('TB_Spam') ->whereNotNull('sp_word') ->where('sp_word','','') ->pluck('sp_word');});🔎 1️⃣ 'spam_words' 는 캐시 키 이름메모리에 저장할 이름.🔎 2️⃣ 600은 초 단위600초 = 10분👉 10분 동안은 DB 안 조회함🔎 3️⃣ 동작 방식📌 첫 요청'spam_words' 캐시에 없음DB 조회 실행결과 저장결과 반환📌 10분 안의 다음 요청들..