http-caching

Why is Firefox ignoring cache control on Range-based queries?

狂风中的少年 提交于 2020-01-24 09:02:13
问题 Web servers have the ability to stream media (audio in this example) to browsers. Browsers use HTML5 controls to play the media. What I'm discovering, however, is that Firefox is caching the media, even though I (believe I) explicitly tell it not to. I have a hunch that it has something to do with the 206 Partial Content response as a regular "non-range" GET with a full 200 OK response does not get cached. Chrome (27) handles this OK, but Firefox (21) does not: HTTP/1.1 206 Partial Content

Cache-control: Is it possible to ignore query parameters when validating the cache?

放肆的年华 提交于 2020-01-15 03:33:11
问题 Is it possible to set a cache-control header communicating with a reverse proxy to ignore query parameters in determining what is a unique uri or in short: validate a cache even if some query parameters have changed? Sometimes query parameters have nothing to do with the rendering of the page at least from a server side perspective. For instance all utm_* variables from Google Adwords. These are needed for the javascript on your page so you don't want to strip them away and redirect to a

How to generate 'last-modified' http header for a resource?

懵懂的女人 提交于 2020-01-06 06:08:58
问题 I currently read this about ' last-modified ' HTTP header. Though I have read number of sources, I'm still confused how it is generated for a particular resource. Is it solely depends on the time stamp when the resource has changed in the db. i.e. as PUT requests are processed for the db. on the same resource? Or are there any generalized or nearly generalized logic to tackle the problem? And the generation of last-modified time, is it solely a responsibility of the actual application? or are

Heroku & Rails - Varnish HTTP Cache Not Working

你离开我真会死。 提交于 2020-01-05 04:03:06
问题 My heroku website's root page is essentially static, it has some ruby code in the view when its generated, but there's nothing specific to a single user, so I'd like to have it cached by Varnish and served up without hitting my dyno (note that there are other pages that are dynamic in the application). Heroku makes it seem very simple here. Just add response.headers['Cache-Control'] = 'public, max-age=300' and it'll cache for 5 minutes before regenerating. To test this I made the changed and

Can I specify a --proxy-all parameter to WireMock to match any web site when recording?

我是研究僧i 提交于 2020-01-04 04:20:07
问题 I am building a proxy service to record and play responses from the web using WireMock. I have recently discovered that these two modes are separate, so am attempting to build a small set of Docker containers to run these services in parallel. Briefly, my plan is to set up one WireMock for recording, and then have another instance (on a different port) for playback. I'll periodically copy the mappings from one to the other on a cron, and then send the reset API call to the playback instance

Does Cache-Control s-maxage header override Expires header for browser cache?

爷,独闯天下 提交于 2020-01-04 03:18:27
问题 I want to set a far future Expires headers to reduce requests made from individual browsers. I'd also like to set Cache-Control: s-maxage=600 so that proxy caches (and CDNs) revalidate with the origin every 10 minutes for fresh content. Will browsers honour the Expires header despite the existence of a Cache-Control header (which supposedly supersedes it) with a s-maxage directive? 回答1: If a response includes both an Expires and a Cache-Control max-age directive, the max-age overrides the

Poco c++Net: Http get headers from response

╄→гoц情女王★ 提交于 2020-01-03 16:55:51
问题 Im using POCO C++ Net libraries for http I want to try make a strategy for persistent caching. First of all I think I need to get expires from the cache headers and cross check with cached values (please tell me if I'm wrong). So how can I extract the cache header from httpResponse ? I've seen that you can do this in Java, (getFirstHeader()), but how do I do it in POCO C++? Below is an ordinary http GET-request using POCO: try { // prepare session URI uri("http://www.google.se");

MVC3 OutputCache not working on Server and Client as expected

£可爱£侵袭症+ 提交于 2020-01-01 10:09:07
问题 I'm having trouble using the OutputCache attribute in Microsoft's MVC3 framework. Please imagine the following controller action, which can be used as part of an AJAX call to get a list of products based on a particular manufacturerId: public JsonResult GetProducts(long manufacturerId) { return Json(this.CreateProductList(manufacturerId), JsonRequestBehavior.AllowGet); } I want this result to be cached on the server to avoid making excessive database queries. I can achieve this by configuring

MVC3 OutputCache not working on Server and Client as expected

孤街浪徒 提交于 2020-01-01 10:09:06
问题 I'm having trouble using the OutputCache attribute in Microsoft's MVC3 framework. Please imagine the following controller action, which can be used as part of an AJAX call to get a list of products based on a particular manufacturerId: public JsonResult GetProducts(long manufacturerId) { return Json(this.CreateProductList(manufacturerId), JsonRequestBehavior.AllowGet); } I want this result to be cached on the server to avoid making excessive database queries. I can achieve this by configuring

Authorization check for HTTP Caches

有些话、适合烂在心里 提交于 2019-12-30 11:18:03
问题 I have Web API method as listed below, for a REST service. This is for getting all users information for InventoryAuditors. Only authorized InventoryAuditor users can access this resource. [RoutePrefix("api/users")] public class UsersController : ApiController { [Authorize(Roles="InventoryAuditor")] [Route("")] [HttpGet] public List<User> GetAllUsers() { //Return list of users } } public class User { public int UserID { get; set; } public string FirstName { get; set; } } Questions Is this