Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
Vue js: cache for speed up API request

i'm new to Vue js and i created my first project using Node JS APIs and it's working good but a bit slow when multiple request achieve so i created a cache for each API but as i can see it cached data for short period of time and then i need to wait again and when cached it's not really fast, below i created an API.js folder and i stored all my API calls in it.. is there a way to achieve cache best practice in Vue js? thanks in advance

import axios from 'axios'
import { cacheAdapterEnhancer } from 'axios-extensions';

const http = axios.create({
    baseURL: 'https://******.herokuapp.com/',
    headers: { 'Cache-Control': 'no-cache' },
    // cache will be enabled by default
    adapter: cacheAdapterEnhancer(axios.defaults.adapter)
});

class BuildingsService {
    getBuildings(){
          return http.get('buildings/api/');
    }
    getFlats(id){
         return http.get(`flats/api/${id}`);
    }
    notifications(){
          return http.get('notifications/api/');
    }

    getOneBuilding(id){
          return http.get(`buildings/api/${id}`)
    }
   getAllFlats(){
           return http.get(flats/api/')
      }

    


}


export default new BuildingsService();

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda