Skip to content
Back to skills

Ps Theme Cache

ASecurity

Makes a PrestaShop CSS/JS change actually reach the browser when the theme combines assets into themes/<theme>/assets/cache/theme-*.css and bottom-*.js (CCC, Panda child themes). Use when a custom.css or theme JS edit is saved but the page still looks unstyled, when the stylesheet loaded is assets/cache/theme-<hash><n>.css, or right after deploying a theme change to PRE/PROD ("el CSS no se actualiza", "no se ve el cambio", "borra la caché del tema", "PS_CCCCSS_VERSION", "limpiar caché CSS tra...

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 9, 2026
developmentgophpbashsqlvuegitdatabase

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add educlopez/mallard --skill ps-theme-cache --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ps Theme Cache?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ps Theme Cache
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/educlopez-ps-theme-cache/badge)](https://www.skillsdirectory.com/skills/educlopez-ps-theme-cache)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ps-theme-cache
description: >
  Makes a PrestaShop CSS/JS change actually reach the browser when the theme
  combines assets into themes/<theme>/assets/cache/theme-*.css and bottom-*.js
  (CCC, Panda child themes). Use when a custom.css or theme JS edit is saved
  but the page still looks unstyled, when the stylesheet loaded is
  assets/cache/theme-<hash><n>.css, or right after deploying a theme change to
  PRE/PROD ("el CSS no se actualiza", "no se ve el cambio", "borra la caché del
  tema", "PS_CCCCSS_VERSION", "limpiar caché CSS tras el deploy").
version: "0.1.1"
metadata:
  author: Eduardo Calvo
---

# PS theme cache — que el CSS/JS nuevo se sirva

## Cuándo ocurre

El tema no sirve `assets/css/custom.css` directamente: lo agrupa en
`themes/<theme>/assets/cache/theme-<hash><version>.css` (y `bottom-*.js`). Si cambias
`custom.css` o un `.tpl` con clases nuevas, el HTML ya sale con el markup nuevo pero el CSS agrupado es el
viejo. Síntoma típico: el elemento aparece **sin estilo** (por ejemplo, un badge como texto plano).

Confirmar en el navegador:
```js
[...document.styleSheets].map(s => s.href).filter(h => h && /assets\/cache/.test(h))
```
El nombre acaba en la versión (`theme-ff491a1214.css` → versión `1214`). Si el estilo nuevo no está en
`getComputedStyle`, es esto.

## Local (Lando)

La versión vive en `{prefix}configuration`, `name = 'PS_CCCCSS_VERSION'`, **una fila por tienda**
(`id_shop` NULL + cada tienda). Subirla genera un fichero nuevo:

```bash
cat > q.sql <<'EOF'
UPDATE {prefix}configuration SET value = value + 1 WHERE name = 'PS_CCCCSS_VERSION';
EOF
lando ssh -s database -c "mysql -uroot <recipe> -e 'source /app/q.sql'"; rm q.sql
lando php bin/console cache:clear
```
Recarga la página (con una pausa: si el JS corre antes de que cargue, `querySelector` devuelve null).

Antes de lanzar el SQL: el prefijo sale de `database_prefix` en `app/config/parameters.php` (en ps9-espaciopiessanos es `sp9_`, no `ps_`) y la BD de Lando es `lemp` con la receta `lemp` (usuario `root`). Si la `cache:clear` se queda sin memoria, añade `-d memory_limit=-1` al `php` y usa `--no-warmup`. Si el CSS sigue siendo el viejo, comprueba que el nombre del fichero cacheado cambió de versión antes de buscar otra causa.

## PRE / PROD

Después de un pull que toque `assets/css/` o `templates/` con clases nuevas, hay que regenerar la caché:

1. **Preferido:** Backoffice → Parámetros avanzados → Rendimiento → **Borrar caché**. En multitienda,
   hazlo en *todas las tiendas* (cada una tiene su versión).
2. Alternativa por servidor: subir `PS_CCCCSS_VERSION` de esa tienda en +1 (y `PS_CCCJS_VERSION` si cambió JS). Si la tienda corre en entorno `dev` (modo depuración), limpia también la caché `dev`: `bin/console cache:clear --env=dev --no-warmup`. Es una escritura en la DB del
   servidor: pedir confirmación antes, sobre todo en PROD.

No borres a mano los ficheros de `assets/cache/`: es salida generada y se regenera sola.

## Verificar

Abrir la ficha en el navegador, esperar ~3 s y comprobar que el `href` del CSS cambió de versión y que el
estilo nuevo se aplica (`getComputedStyle(el).backgroundColor`, etc.).

## Gotchas

- `themes/<theme>/assets/cache/` suele aparecer como no trackeado en `git status`: **no lo commitees**.
- La herramienta JS del navegador puede bloquear páginas cuyo URL lleve query string
  (`?controller=product&id_product=…`): usa la URL amigable del producto.
- Si el cambio es solo `.tpl` sin CSS nuevo, basta `bin/console cache:clear` (Smarty); no hace falta tocar CCC.
- Esto no sustituye al pipeline de `ps-css-build` (ese es para proyectos con `_dev/css`); aquí el CSS se edita
  a mano en `custom.css` y solo falta invalidar la caché.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.