Skip to content
Snippets Groups Projects
Commit 00397136 authored by Dapeng's avatar Dapeng
Browse files

add cache-control header for ajax request to by-pass proxy cache

parent 4e64a0b5
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,12 @@ package org.springframework.samples.petclinic;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@SpringBootApplication
public class PetClinicApplication {
......@@ -10,3 +16,4 @@ public class PetClinicApplication {
SpringApplication.run(PetClinicApplication.class, args);
}
}
......@@ -4,7 +4,11 @@ var petClinicApp = angular.module('petClinicApp', [
'ngRoute', 'layoutNav', 'layoutFooter', 'layoutWelcome',
'ownerList', 'ownerDetails', 'ownerForm', 'petForm', 'visits', 'vetList']);
petClinicApp.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
petClinicApp.config(['$locationProvider', '$routeProvider', '$httpProvider', function(
$locationProvider, $routeProvider, $httpProvider) {
// safari turns to be lazy sending the Cache-Control header
$httpProvider.defaults.headers.common["Cache-Control"] = 'no-cache';
$locationProvider.hashPrefix('!');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment