FAQ Database Discussion Community


Which headers allow a browser to reuse a file from cache without contacting the server at all?

http,browser-cache,cache-control,http-caching
Conversely, which headers cause a browser to contact the server the next time around to check if the cached file is still valid? Cache-Control:max-age=14400 Content-Length:1375502 Content-Type:application/json Date:Wed, 04 Feb 2015 20:51:47 GMT ETag:"b88aa553-6456-4844-b5bc-173ad8b9e0a1" Above headers are from the original request. When I re-request it, I get a 304. ...

Getting latest Json from Apache2 server with AngularJS

javascript,json,angularjs,apache2,browser-cache
I have some jsons on my apache2 server and I get my data in my controllers, usually with no problems. Sometimes when I update a json, my App doesn't seem to get the latest data. I found out that it's caused by browser's cache and when I clean it my...

Why does the web server sent the file instead of a 304 http: not modified?

apache,http-headers,browser-cache
My browser send to the server the following request: Host: www.imprimante.be User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 Accept: */* Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate If-Modified-Since: Fri, 29 May 2015 14:22:44 GMT If-None-Match: "90-5173935ad3a1a-gzip" Referer: http://www.imprimante.be/premier-avis-gratuit/ Cookie: <hidden> Connection: keep-alive The url used is http://www.imprimante.be/wp-content/themes/mch_imprimante/js/theme.min.js? (note:...

Asp.Net - ClientCache - can it vary by file type?

asp.net,caching,iis,web-config,browser-cache
I've been taking a look, and implemented client caching on a development project I'm currently working on. As I'm using Asp.Net, I've updated the web.config file directly with the following code: <staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /> </staticContent> I've also implemented a 'fingerprinting' solution which allows me to expire CSS and...

Google Chrome fetches HTML files from cache when cache manifest is present

google-chrome,caching,browser-cache,cache-control
I have a web site where I added a CACHE MANIFEST file. This was to ensure that full-screen web apps in iOS wouldn't fetch things from cache. (Otherwise, they seem to refresh HTML properly, but not linked JavaScript or CSS.) In my application, off-line access is totally useless, so I...

Cache doesn't work, images are reloaded each time

php,html,google-chrome,browser-cache
I am building a very simple page here: http://www.wordjackpot.com My problem appears in Google Chrome only, when I reload the page, the images are reloaded each time as if there's no cache, I'm not sure if the problem comes from my code or from chrome because for the example on...

CodeIgniter session issue after sign out browser back button landed to the secured page

php,codeigniter,session,browser-cache
I am using codeIgniter 2.1.4 in my application. If am in a page that require authentication. Then I logout after logout if I use browser back button it will get me back to the secured page. I can only view the page. If I refresh or click on any link...

How to refresh the page's cache if scripts have been updated?

javascript,php,css,html5,browser-cache
I searched online to find a solution for refreshing user cache if the website has been updated. Couldn't find anything apart from setting version control on url of the script files... I'm answering my question below, and need to know if this is a perfect code and might not keep...

PHP - Weird page refresh issue

php,browser-cache
Pages on my php site need to be refreshed all the time. For example I have a timetable for each user that's different and if I login and view the timetable and logout, then when I login as a different user and view that timetable it will show the previous...

Does phantomjs regularly clear its cache automatically?

phantomjs,browser-cache
I need to change the default time of automatic cache clear for Phantomjs if there is such a feature. Any idea?

How to enable browser cache for images, css and js files separately in web.config?

asp.net,iis-7.5,browser-cache
I am running an asp.net application and want to set browser cache age limit for images(jpeg,png,gif), css and js files separately based on the extension. Please help me how to do this either in web.config file or in IIS?...

Website html doesnt update for users because of cache

html,caching,browser-cache
I am making a website and am running into an issue with website cache for my users. I develop my website and have set chrome developer tools to disable cache for my website for development. The issue is when i release a new change to prod all my users don't...

AJAX HttpRequest doesn't recieve updated data from servlet

ajax,http,servlets,browser-cache
Servlet: package world.hello; import java.io.IOException; import java.io.PrintWriter; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import world.hello.MyMainClass; public class TestServlet extends HttpServlet{ private static final int BYTES_DOWNLOAD =...

How to remove/replace cached css and js file from client Browser?

javascript,css,browser,browser-cache
Is there a way by which we can replace or remove the cached css and js files from client browser when they come to the website next time?

Using Browserify with a revision manifest in Gulp, getting “Error: write after end”

gulp,browser-cache,browserify,react-jsx
I'm trying to compile a React app, append a hash to the output filename and produce a revision manifest, so that I can tell the browser to cache it forever. The problem is that the dozen or so tools involved don't all work together perfectly, at least as far as...

Should I bundle a javascript framework with my application or use a public CDN?

javascript,caching,browser-cache,performance-testing,cdn
About two or three years ago, I would have summarised the answer to this as. compile all js to one file and minify. complie all css to one file and minify. load external scripts async. set cache control headers to the far future. fingerprint asset urls for invalidation. use your...

Caching in Webview is not working in Android

android,caching,webview,browser-cache,offline-caching
When I open webview, it runs great when there is a network connection, but I have enabled caching in it, and without a network connection, it shows an error and loaded cached web page is not showing. I have enabled caching and also set cache mode, but it's not working....

Cache strategy for ServiceWorker

javascript,browser-cache,service-worker
What cache strategies are you using? I read the Offline Cookbook and the simplest strategy to use is to cache static content and the left out the API calls. This strategy seems something like this: Check if the request is already in cache If not add the request, response pair...

Cache video background

performance,css3,caching,browser-cache
I have a background video that plays on my site this is working well but I noticed the browser is always downloading the video as it loops and if the wifi disconnects the video stops playing. I have googled cacheing background videos but have had not luck finding relevant answers...

Why is my web app crashing after multiple GET requests?

javascript,jquery,python,server,browser-cache
I have a web page that is running on a Python Bottle server. I have a piece of JQuery that calls a GET request every second so I can refresh part of my page. It works fine for about 8 hours..but then when I leave it running overnight, the browser...

Why directive templates sometimes are loaded from server (with 304 response) and sometimes from browser cache (no request at all)?

javascript,angularjs,angularjs-directive,browser-cache
When I reload page, Angular directive templates are loaded in two ways. First one - browser makes a request to the server and it responses with 304 - it's ok. But the second one - browser doesn't make a request. And I can't guess why. As a result, when I...