# Cache Dokumani

Bu dokuman, `home`, `portfolio` ve `settings` app'lerinde yapilan cache
ayarlarini ve otomatik cache temizleme (invalidation) akislarini aciklar.

## Genel

- Cache suresi: 5 dakika (`60 * 5` saniye).
- Cache Django cache backend uzerinden tutulur (`django.core.cache.cache`).
- Veri ekleme, silme ve guncelleme (post_save/post_delete) veya M2M degisimi
  oldugunda ilgili cache temizlenir.

## Home App

### Cache Key'leri

- `home:active_home`
- `home:active_aboutme`
- `home:service_list`
- `home:service_title`
- `home:resume`
- `home:education_list`
- `home:experience_list`
- `home:skill_list`
- `home:knowledge_list`
- `home:active_menu`

### Cache Kullanan Endpoint'ler

- `HomeDetailView` -> `home:active_home`
- `AboutMeDetailView` -> `home:active_aboutme`
- `MyServiceList` -> `home:service_list`
- `MyServiceTitleDetailView` -> `home:service_title`
- `MyResumeDetailView` -> `home:resume`
- `EducationListView` -> `home:education_list`
- `ExperienceListView` -> `home:experience_list`
- `SkillListView` -> `home:skill_list`
- `KnowledgeListView` -> `home:knowledge_list`
- `MainMenuDetailView` -> `home:active_menu`

### Cache Temizleme

`home/signals.py` uzerinden asagidaki modellerde degisim oldugunda
tum `home:*` cache'leri temizlenir:

- `Home`
- `AboutMe`
- `MyService`
- `MyServiceTitle`
- `MyResume`
- `Education`
- `Experience`
- `Skill`
- `Knowledge`
- `MainMenu`

Ek olarak `Home.tags` M2M degisimi (`post_add`, `post_remove`, `post_clear`)
oldugunda cache temizlenir.

## Portfolio App

### Cache Key'leri

- `portfolio:category_list`
- `portfolio:category_detail:<slug>`
- `portfolio:portfolio_list`
- `portfolio:portfolio_detail:<pk>`

### Cache Kullanan Endpoint'ler

- `CategoryList` -> `portfolio:category_list`
- `CategoryDetail` -> `portfolio:category_detail:<slug>`
- `PortfolioList` -> `portfolio:portfolio_list`
- `PortfolioDetail` -> `portfolio:portfolio_detail:<pk>`

### Cache Temizleme

`portfolio/signals.py` uzerinden asagidaki durumlarda cache temizlenir:

- `Category` kaydi kayit/silme/guncelleme -> kategori list ve ilgili detay
- `Portfolio` kaydi kayit/silme/guncelleme -> portfolio list ve ilgili detay
- `Portfolio.categories` M2M degisimi -> ilgili portfolio detay ve list

## Settings App

### Cache Key'leri

- `settings:detail`
- `settings:site_status`

### Cache Kullanan Endpoint'ler

- `SettingDetailView` -> `settings:detail`
- `SettingOpenCloseDetailView` -> `settings:site_status`

### Cache Temizleme

`settings/signals.py` uzerinden asagidaki modellerde degisim oldugunda
tum cache temizlenir:

- `Setting`
- `SiteSettings`

## Notlar

- Signal'larin calismasi icin `apps.py` icindeki `ready()` metodlari
  ile signal moduleri yuklenir:
  - `home/apps.py`
  - `portfolio/apps.py`
  - `settings/apps.py`
