cache-control

Cache php-generated image until it changes

☆樱花仙子☆ 提交于 2019-12-12 17:55:51
问题 I apologize in advance for my lack of knowledge on this subject; I've looked at lots of other posts but can't get any of their solutions to work for me. Anyway, I'm using a dynamic displayimage.php file to show users' profile pictures on a site I'm working on. The page takes an id parameter, and pulls the image filename from a mysql database. Here's the (abbreviated) code: $id = mysql_real_escape_string($_GET[id]); $table = "images_user"; $idname = "userid"; $uploaddir = "/home/username

MASSIVE GOOGLE MAPS. 5000 places, 5MB. How to make it faster?

不羁岁月 提交于 2019-12-12 10:18:09
问题 I'm trying to load a Google Maps v3 that shows 5000 markers clickable. My JS contains 10 lines per place: var myLatlng_4821 = new google.maps.LatLng(43.0754329,-71.4699752); var contentString_4821 = "<b>Place 1</b>"; var infowindow_4821 = new google.maps.InfoWindow({content: contentString_4821}); var marker_4821 = new google.maps.Marker({ position: myLatlng_4821, map: map, icon: image }); google.maps.event.addListener(marker_4821, 'click', function() { infowindow_4821.open(map,marker_4821); }

Why would ETags set to a MUST requirement if you already have the resource?

牧云@^-^@ 提交于 2019-12-12 08:47:09
问题 Why would you set ETags to a "MUST requirement level"? You obtains the resource before the ETags returned... I'm working on a project where I am the client that sends HTTP requests to a server that returns an HTTP Cache-Control header with ETags to cache response (where in each addition request it gets compared to the If-None-Match header to determine if the data is stale and if a new request should be made). In my current project the ETags parameter is using the conditional GET architecture

Cache control not working when hit refresh in the browser

社会主义新天地 提交于 2019-12-12 04:33:11
问题 I'm trying to implement cache control on my application. I've set up the tomcat filter for the all fonts giving a max-age=120. When I request a font for the first time with the cache cleared, the call/response is the following: and as you can see I have the max-age response. Now I expect that if I hit refresh the browser won't send the http request again instead this is what happens: As you can see the second request has a cache-control: max-age=0 value and the response is returned from the

How to avoid “Web page has expired” in IE

柔情痞子 提交于 2019-12-12 03:54:46
问题 I have a page with a form. When I post the form, then I click the previous button in IE, I have an error : " The web page has expired " As I seen it in this post, I tried : <meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0"> <meta http-equiv="Pragma" content="no-cache"> Now, I don't have the expired message anymore, but the form just auto revalidate . When I click the previous button, I see I go back to my form page, then I just return to

cache-control not working without etag

梦想的初衷 提交于 2019-12-12 03:54:26
问题 I am sending the following header in the reponse. "Cache-Control: public, max-age=300" , but still every time I hit refresh I get a 200 response(the request is made to he server again). Same happens if I add the "Expires" header. But if I add a ETag to the headers, then I get 304 on refresh(the request goes to the server, the server prepares the response, then matches the ETag and returns a 204 response). What should I change so that "Cache-Control" header is used and the content is served

How does a cache miss EXACTLY occur?

自作多情 提交于 2019-12-12 02:52:08
问题 I'm trying to understand how exactly a cache miss occurs. So far this is the way I understand it: CPU requests for address x, searches its own (L1/L2) cache for it. If it is not there then it's a cache miss. Now what is missing here is how exactly does it find out that the information is not available in cache? What information do cache lines reserve? So far I know a cache line should contain this information: Address of the information, Data within that address. Having this information CPU

Where is .htaccess located in ubuntu apache2?

懵懂的女人 提交于 2019-12-12 01:26:01
问题 I've already enable headers using command a2enmod headers ,i want to vim it to edit cache-control allowed http no_cache, just don't know where is .htaccess located. 回答1: .htaccess is a control file which can be located in arbitrary folder in order to overwrite apache default settings regarding that folder and its subfolders. Create that file inside the document root of your project and edit it. 来源: https://stackoverflow.com/questions/19398182/where-is-htaccess-located-in-ubuntu-apache2

Disable browser caching HTML5

扶醉桌前 提交于 2019-12-11 18:23:52
问题 I would like to know how to disable the browser cache, using HTML5. I found this useful post (How to control web page caching, across all browsers?), but it contains the info only for HTML4 or other languages. In my web application I use Java ( Spring Boot ) and Thymeleaf to produce HTML5. I would like to understand what are the equivalent tags for HTML5, of the following HTML tags: <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http

Maintaining cache control property on a file when it is returned as Stream from VirtualPathProvider

浪子不回头ぞ 提交于 2019-12-11 15:25:42
问题 I have implemented a VirtualPathProvider to return Theme files (images,css) for an Azure web site from the Azure CDN. It is working fine apart from one thing: the files that are coming from the CDN all have their cache control property set to "private" and so are never cached. The actual blobs have their properties set correctly and if I access one by it's direct URL (i.e. not through the VPP) then the cache control is correct. The problem seems to be in the Open() method of the VirtualFile