mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 04:55:50 +00:00
add cache-control header for ajax request to by-pass proxy cache
This commit is contained in:
parent
4e64a0b529
commit
00397136b5
2 changed files with 12 additions and 1 deletions
|
@ -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('!');
|
||||
|
||||
|
|
Loading…
Reference in a new issue