fix: update cache configuration and enable caching in Google Sheets API route
This commit is contained in:
1 parent
b89dd3e880
commit
a28058d68c
2 files changed
+7
-6
No files matched your search
@@ -1,11 +1,12 @@
|
|||||||
import { google } from 'googleapis';
|
import { google } from 'googleapis';
|
||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
// Habilitar/desabilitar cache
|
|
||||||
const ENABLE_CACHE = false;
|
|
||||||
|
|
||||||
// Configurar cache de 1 hora (se habilitado)
|
// Configurar cache de 1 hora (sempre exportar um número, 0 = sem cache)
|
||||||
export const revalidate = ENABLE_CACHE ? 3600 : 0;
|
export const revalidate = 3600;
|
||||||
|
|
||||||
|
// Habilitar/desabilitar cache
|
||||||
|
const ENABLE_CACHE = revalidate > 0;
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "esp32",
|
"name": "espdocs",
|
||||||
"version": "0.1.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev --turbopack",
|
||||||
|
|||||||
Reference in new issue
Block a user