Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6a92f75ea | ||
|
|
0eea6234d6 | ||
|
|
77bf6089fb |
@@ -9,17 +9,17 @@ import { getProductBySlug, getProducts } from "@/lib/headless/client";
|
|||||||
|
|
||||||
interface ProductPageProps { params: Promise<{ slug: string }> }
|
interface ProductPageProps { params: Promise<{ slug: string }> }
|
||||||
|
|
||||||
// Sin esto, la página queda estática para siempre con los datos del build
|
// generateStaticParams + revalidate quedaban aquí para pre-renderizar en
|
||||||
// (que usa el catálogo mock porque HEADLESS_PROVIDER/MEDUSA_* no existen en
|
// build time, pero HEADLESS_PROVIDER/MEDUSA_* no existen en el contexto del
|
||||||
// el contexto del Docker build). El listado sí se refresca porque su ruta
|
// Docker build: el snapshot estático quedaba congelado con el catálogo mock
|
||||||
// es dinámica por searchParams; esta ruta necesita el revalidate explícito
|
// (todos los productos con price: null) hasta que ISR lo revalidara. Con
|
||||||
// para que el runtime (que sí tiene las env vars de Medusa) la regenere.
|
// frontend-deploy corriendo 2 réplicas y sin cacheHandler compartido, cada
|
||||||
export const revalidate = 60;
|
// pod revalida su propia caché de forma independiente, así que un producto
|
||||||
|
// podía mostrar "Consultar precio" en un pod y el precio real en el otro
|
||||||
export async function generateStaticParams() {
|
// según cuál hubiera sido "calentado". force-dynamic elimina esa caché por
|
||||||
const products = await getProducts();
|
// pod y deja esta ruta en vivo contra Medusa, igual que el listado
|
||||||
return products.map((product) => ({ slug: product.slug }));
|
// (dinámico por searchParams).
|
||||||
}
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
export async function generateMetadata({ params }: ProductPageProps): Promise<Metadata> {
|
export async function generateMetadata({ params }: ProductPageProps): Promise<Metadata> {
|
||||||
const { slug } = await params;
|
const { slug } = await params;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ spec:
|
|||||||
memory: 64Mi
|
memory: 64Mi
|
||||||
|
|
||||||
- name: migrations
|
- name: migrations
|
||||||
image: gitea.cruzcloud.net/devops/ecommerce-medusa:v1.0.85
|
image: gitea.cruzcloud.net/devops/ecommerce-medusa:v1.0.88
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- npx
|
- npx
|
||||||
@@ -73,7 +73,7 @@ spec:
|
|||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: medusa
|
- name: medusa
|
||||||
image: gitea.cruzcloud.net/devops/ecommerce-medusa:v1.0.85
|
image: gitea.cruzcloud.net/devops/ecommerce-medusa:v1.0.88
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ spec:
|
|||||||
- name: gitea-registry-secret
|
- name: gitea-registry-secret
|
||||||
containers:
|
containers:
|
||||||
- name: web
|
- name: web
|
||||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.86
|
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.87
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user