Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!