How to add Cache-Control header to static resource in Spring Boot?

This happens because of Spring Security: it rewrites all cache headers to disable caching totally. So we need to do two things: Disable spring security for static resources Enable static resource cache processing In current version of Spring Boot we can change this behavior in application.properties config. Disable spring security for some resources: # Comma-separated … Read more

Cache-control: no-store, must-revalidate not sent to client browser in IIS7 + ASP.NET MVC

Through trial and error, I have found that one way to set the headers correctly for IIS7 in ASP.NET MVC is: Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.AppendCacheExtension(“no-store, must-revalidate”); Response.AppendHeader(“Pragma”, “no-cache”); Response.AppendHeader(“Expires”, “0”); The first line sets Cache-control to no-cache, and the second line adds the other attributes no-store, must-revalidate. This may not be the only way, but does provide … Read more

How to make Microsoft XmlHttpRequest honor cache control directive

Unfortunately the XMLHttpRequest object was designed this way, because it is based on WinInet. Also, it is not recommend to be used from the server side. You should use ServerXMLHttpRequest, which has the same functionality, but depends on WinHTTP instead. See the FAQ for more information. A description from the ServerXMLHttp documentation states that: The … Read more

What is difference between max-age and max-stale in cache control mechanism

From RFC 7234: The “max-age” request directive indicates that the client is unwilling to accept a response whose age is greater than the specified number of seconds. Unless the max-stale request directive is also present, the client is not willing to accept a stale response. … The “max-stale” request directive indicates that the client is … Read more

No expires header sent, content cached, how long until browser makes conditional GET request?

From the the HTTP caching spec (section 13.4): Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after successful validation. This means that a user agent … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)