Communitygithub.com

ComeOnOliver/skillshub

워드프레스 개발 중 SiteGround 캐싱(SG CachePress + LiteSpeed)을 우회합니다. 실시간 개발 테스트를 위해 자식 테마에 캐시 파기 코드를 추가합니다.

skillshub란 무엇인가요?

이 스킬은 SiteGround 호스팅 환경에서 워드프레스 개발 시 SiteGround의 캐싱 시스템(SG CachePress 및 LiteSpeed Cache)을 우회하여 실시간 개발 테스트를 가능하게 합니다. 워드프레스 자식 테마의 functions.php에 캐시 파기 코드를 자동 주입하거나 수동으로 추가할 수 있습니다. 이 스킬은 스테이징 사이트에만 배포를 허용하며, 프로덕션 사이트에 대한 쓰기 작업은 절대 허용하지 않습니다. FTP/SFTP 자격 증명과 사이트 URL, 테마 경로를 수집하여 Claude가 스테이징 환경에 안전하게 코드를 배포할 수 있도록 지원하며, 관리자 로그인 시 캐시 우회 및 브라우저 캐시 파기를 위한 헤더 전송, CSS/JS URL에 타임스탬프를 추가하는 기능을 제공합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazyswami/siteground-cache

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

SiteGround 캐시 파기 스킬

SiteGround 캐싱(SG CachePress + LiteSpeed)을 우회하여 워드프레스 개발을 진행합니다. 자식 테마에 캐시 파기 코드를 추가하여 실시간 개발 테스트를 가능하게 합니다.


⛔ 중요: 스테이징 전용 - 절대 프로덕션 사용 금지

Claude는 프로덕션 사이트에 배포하는 것이 금지되어 있습니다.

작업허용 여부
스테이징에 배포✅ 가능
프로덕션에 배포❌ 절대 안 됨
프로덕션에서 읽기✅ 가능 (읽기 전용)
프로덕션에 쓰기❌ 절대 안 됨

사용자가 프로덕션에 배포를 요청하면:

  1. 요청을 거부합니다.
  2. 프로덕션 배포는 사용자가 직접 수동으로 해야 한다고 설명합니다.
  3. 대신 스테이징에 배포하는 것을 제안합니다.

프로덕션 경로는 차단되어 있습니다. "staging"을 포함하지 않는 모든 경로는 쓰기 작업이 금지됩니다.


필요 정보

이 스킬을 사용하기 전에 Claude가 다음 정보를 요청합니다:

  1. FTP/SFTP 자격 증명

    • 호스트명 (예: ftp.example.com)
    • 사용자 이름
    • 비밀번호
    • 포트 (일반적으로 FTP는 21, SFTP는 22)
  2. 사이트 URL

    • 스테이징 URL (예: https://staging.example.com)
    • 프로덕션 URL (필요 없음 - Claude는 그곳에 배포하지 않음)
  3. 테마 경로

    • 자식 테마 폴더 이름 (예: theme-child)

자격 증명은 프로젝트의 CLAUDE.local.md에 저장합니다 (gitignore 처리됨) – 이후 세션에서 재사용 가능.


스테이징 전용 워크플로우

로컬 개발 → 스테이징 사이트 → [사용자 수동] → 프로덕션
        ↑              ↑                   ↑
    Claude 편집   Claude 배포         사용자 배포

Claude 담당: 로컬 편집 + 스테이징 배포 사용자 담당: 프로덕션 배포 (SiteGround, FTP 클라이언트 또는 수동으로)


기능 설명

  1. 관리자를 위한 서버 사이드 캐싱 비활성화 - LiteSpeed Cache + SG CachePress
  2. no-cache 헤더 추가 - CDN/프록시 캐싱 방지
  3. 브라우저 캐시 파기 - CSS/JS URL에 타임스탬프 추가
  4. 버전 배너 표시 - 테마가 로드되고 있음을 시각적으로 확인 (관리자 전용)

코드

PHP 스니펫 (functions.php에 추가)

<?php
/**
 * SiteGround 캐시 파기 (개발용)
 * 로그인한 관리자의 캐싱을 비활성화합니다.
 * 테스트 완료 후 프로덕션에서 제거하거나 비활성화하세요.
 */

// 개발 모드 배너 (테마가 활성 상태임을 확인하는 배너 표시)
add_action('wp_head', 'sg_dev_mode_banner');
function sg_dev_mode_banner() {
    if (current_user_can('administrator')) {
        $theme = wp_get_theme();
        $version = $theme->get('Version');
        $name = $theme->get('Name');
        echo '<style>
            .sg-dev-banner {
                position: fixed;
                bottom: 20px;
                right: 20px;
                background: #34889A;
                color: white;
                padding: 10px 20px;
                border-radius: 8px;
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
                font-size: 12px;
                z-index: 999999;
                box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            }
        </style>
        <div class="sg-dev-banner">
            ' . esc_html($name) . ' v' . esc_html($version) . ' - ' . date('M j, H:i') . '
        </div>';
    }
}

// 관리자의 모든 캐싱 비활성화
add_action('init', 'sg_disable_cache_for_dev');
function sg_disable_cache_for_dev() {
    if (current_user_can('administrator')) {
        // LiteSpeed Cache 비활성화
        if (!defined('LSCACHE_NO_CACHE')) {
            define('LSCACHE_NO_CACHE', true);
        }

        // SG Optimizer/CachePress 비활성화
        if (!defined('SG_CACHEPRESS_NO_CACHE')) {
            define('SG_CACHEPRESS_NO_CACHE', true);
        }

        // no-cache 헤더 전송
        nocache_headers();

        // CDN 우회를 위한 추가 헤더
        header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
        header('Pragma: no-cache');
        header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
    }
}

// 브라우저 캐시 파기: 테마 CSS/JS URL에 타임스탬프 추가
add_filter('style_loader_src', 'sg_bust_asset_cache', 999);
add_filter('script_loader_src', 'sg_bust_asset_cache', 999);
function sg_bust_asset_cache($src) {
    if (current_user_can('administrator')) {
        // 테마 자산만 캐시 파기
        $theme_uri = get_stylesheet_directory_uri();
        $parent_uri = get_template_directory_uri();

        if (strpos($src, $theme_uri) !== false || strpos($src, $parent_uri) !== false) {
            $src = add_query_arg('v', time(), $src);
        }
    }
    return $src;
}

사용 방법

방법 1: 스크립트를 통한 자동 주입

# 프로젝트로 이동
cd /path/to/wordpress-project

# 주입 스크립트 실행
/root/.claude/skills/siteground-cache/add-cache-buster.sh ./wp-content/themes/your-child-theme

방법 2: 수동 복사

  1. 위의 PHP 코드를 복사합니다.
  2. 자식 테마의 functions.php 끝에 붙여넣습니다.
  3. FTP를 통해 스테이징에만 업로드합니다.
  4. 관리자로 스테이징 사이트에 접속하면 버전 배너가 표시됩니다.

방법 3: Claude를 통해

다음과 같이 요청하세요:

  • "이 테마에 SiteGround 캐시 파기를 추가해 줘"
  • "SiteGround 개발 모드 활성화해 줘"
  • "functions.php에 캐시 파기 코드를 추가해 줘"

Claude는 스테이징에만 배포합니다.


배포 워크플로우 (스테이징 전용)

1단계: 자격 증명 받기 (사용자에게 요청)

배포하기 전에 사용자에게 다음을 요청합니다:

스테이징에 배포하려면 FTP 자격 증명이 필요합니다. 다음을 제공해 주세요:
1. FTP 호스트 (예: ftp.yourdomain.com)
2. FTP 사용자 이름
3. FTP 비밀번호
4. 스테이징 사이트 경로 (예: staging.yourdomain.com/public_html)

2단계: 스테이징에 배포

# 스테이징 전용 - 절대 프로덕션 안 됨!
lftp -u "사용자,비밀번호" -e "
    set ssl:verify-certificate no
    mirror -R ./child-theme staging.example.com/public_html/wp-content/themes/child-theme
    bye
" ftp://ftp.example.com

3단계: 스테이징에서 확인

  1. 관리자로 스테이징 사이트에 접속합니다.
  2. 개발 배너가 표시되는지 확인합니다 (오른쪽 아래).
  3. CSS/JS 변경 사항이 보이는지 테스트합니다.
  4. PHP 오류가 있는지 확인합니다.

4단계: 사용자가 프로덕션에 배포

Claude는 이 단계를 수행하지 않습니다. 사용자에게 알려줍니다:

변경 사항이 스테이징에 준비되었습니다. 프로덕션에 배포하려면:

옵션 1: SiteGround Site Tools
  - Site Tools > WordPress > Staging으로 이동합니다.
  - "Push to Live"를 클릭합니다.

옵션 2: FTP 클라이언트 (FileZilla, Cyberduck 등)
  - 스테이징에서 다운로드합니다.
  - 프로덕션에 업로드합니다.

옵션 3: 수동 파일 복사 (FTP 사용)

각 부분의 작동 방식

1. LiteSpeed 캐시 우회

define('LSCACHE_NO_CACHE', true);

LiteSpeed Cache 플러그인은 이 상수를 확인하고 설정되면 캐싱을 건너뜁니다.

2. SG CachePress 우회

define('SG_CACHEPRESS_NO_CACHE', true);

SiteGround의 캐싱 플러그인이 이 상수를 인식합니다.

3. HTTP 헤더

nocache_headers();
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');

브라우저와 CDN에 응답을 캐싱하지 말라고 지시합니다.

4. 자산 캐시 파기

add_query_arg('v', time(), $src);

CSS/JS URL에 ?v=1704567890을 추가합니다. 타임스탬프가 매초 변경되므로 브라우저는 항상 최신 파일을 가져옵니다.


문제 해결

배너가 표시되지 않나요?

  • 관리자로 로그인했는지 확인하세요.
  • 자식 테마가 활성화되어 있는지 확인하세요 (디자인 > 테마).
  • 오류 로그에서 PHP 오류를 확인하세요.

여전히 캐시된 콘텐츠가 보이나요?

  1. 시크릿/프라이빗 브라우저 창을 사용해 보세요.
  2. 브라우저 캐시를 수동으로 지우세요.
  3. SiteGround Site Tools > Speed > Caching > Purge Cache를 확인하세요.
  4. Cloudflare가 앞단에 있는 경우 거기서도 캐시를 퍼지해야 합니다.

CSS 변경 사항이 적용되지 않나요?

  • 페이지 소스를 보고 CSS URL에 ?v= 타임스탬프가 있는지 확인하세요.
  • 강력 새로고침: Ctrl+Shift+R (Windows) 또는 Cmd+Shift+R (Mac)

이 스킬의 파일

/root/.claude/skills/siteground-cache/
├── SKILL.md                 # 이 문서
├── add-cache-buster.sh      # 자동 주입 스크립트
├── cache-buster.php         # 독립형 PHP 스니펫
└── remove-cache-buster.sh   # 제거 스크립트

예시 CLAUDE.local.md 템플릿

프로젝트에 저장합니다 (gitignore 처리):

# SiteGround 자격 증명 (커밋 금지)

## FTP 접속 정보
- 호스트: ftp.example.com
- 사용자: [email protected]
- 비밀번호: your-password
- 포트: 21

## 사이트 URL
- 스테이징: https://staging.example.com
- 프로덕션: https://example.com (Claude는 읽기 전용)

## 테마 경로
- 스테이징: staging.example.com/public_html/wp-content/themes/theme-child
- 프로덕션: 접근 금지 (사용자가 수동 배포)

관련 자료

  • wp-docker - 로컬 워드프레스 개발
  • wp-performance - 프로덕션 캐싱 최적화
  • visual-qa - 변경 후 스크린샷 테스트

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬