caching

How to stop browser(espcially Internet Explorer) from doing super caching of javascript?

Hi I don't know what is going on but this is really evident in IE 8. It loads up my page and my javascript files. I then have debug lines in my server side code that should get activated when an ajax request from my jquery comes through. Or some other contact with the server such a refreshing the page. So I have this var timeout; va...

Transfer a variable to earier point without goto

How to write this without goto: ob_start(); $a = 0; echo "START of LEFT<br />"; begin: if($a > 0) { echo "CONTENT LEFT: $a<BR />"; <VERY DIFFICULT ALGORHITM> goto end; } <... ALL THE REST CODE OF LEFT ...> echo "END of LEFT<br /><br />"; $output1 = ob_get_contents(); ob_end_clean(); ob_start(); echo "START ...

Difference between user and system caches using PHP APC.

apc_clear_cache [http://php.net/manual/en/function.apc-clear-cache.php] has an option to send in 'user' which will delete the apc user cache, or else if not present, the system cache. Which is better? I don't understand the difference since there's no way to explicitly store a value in one cache over the other via apc_store/apc_fetch. ...

Browser checks if modified(result=304) when not needed

I am trying to prevent If-modified request from client to server but I am failing. I think that I am missing something so I am attaching the HTTP communication of the two requests. I would expect that the second request will not be issued: GET XXXXX/js/Is.js HTTP/1.1 Accept: */* Referer: http://XXXXX/XXXXX/ Accept-Language: he UA-CPU: ...

HTML Page Caching Question

I understand the basics of HTML page caching. My uncertainty relates to how caching works on images, included external scripts, and included CSS stylesheets that the HTML page uses. For example, let's say I have an HTML page that is set to expire in 7 days. The page has 10 images on it, 2 included external CSS (.css) stylesheets, and 2...

Why would I have to restart rails every time to test a 404.html page here?

Hi there, I'm trying to work out why when working on a 404 page on a rails app I'm working, the only way to see changes I've made to the html on the page is to physically restart the webserver with a ctrl-C followed by a call to script/server. As far as I can tell, I can't see anything particularly wrong with the development.rb config ...

ASP.Net MVC Database-driven menu with caching

Hi. I am trying to create a menu for my website. It needs to meet the following requirements it must be database driven, pulling data from DB to build up the menu structure the data being pulled from the DB needs to be cached - I do not want to hit the DB for each page request At the moment, I have a simplistic example running, but ...

How to do WCF REST Caching?

I have a WCF REST service which needs to return both Static and some filtered data based on what parameters were passed in by the clients(which are fat windows clients) Since the data store which feeds this service doesnt change too often, I wanted to cache this data on the service(Server side caching), The data store is an Azure Table,...

How can you prevent Internet Explorer from caching HTML without using random query-strings

We are currently using random query-strings to prevent Internet Explorer from caching HTML on postbacks, but we are in the process of implementing URL re-writing and it would be nice if we could remove these random parameters. What's the best pratice in this situation? ...

How to use HTTP cache headers with PHP

Hello! I have a PHP 5.1.0 website (actually it's 5.2.9 but it must also run on 5.1.0+). Pages are generated dynamically but many of them are mostly static. By static I mean the content don't change but the "template" around the content can change over time. I know they are several cache systems and PHP frameworks already out there, bu...

A filesystem-based compression cache -- does this exist?

Hi. I'm looking for a program with really quite specific functionality, which hopefully exists so I don't have to implement it myself. I can best describe this hypothetical program as a filesystem-based cache of compressed copies of documents in the working directory. I've made a mock-up of what I would expect this program to do: jam...

Trying to understand the "Vary" HTTP header

I use PHP to generate dynamic Web pages. As stated on the following tutorial (see link below), the MIME type of XHTML documents should be "application/xhtml+xml" when $_SERVER['HTTP_ACCEPT'] allows it. Since you can serve the same page with 2 different MIMEs ("application/xhtml+xml" and "text/html") you should set the "Vary" HTTP header ...

Caching function result f#

Hi there! I have a function which is constant to its argument, for example let is_prime x = (test) But it's pretty large and slow. So I want the result of it to be calculated only once while I'm calling it as often as I want. I've tried to do it in a way I did it in not functional languages: let _is_prime x = (test) let mutable _i...

Ajax "caching", the good, the bad, the indifferent?

So I don't actually mean browser caching of an Ajax request using the GET method, but storing large queries (any number, likely double-digits, of 40 - 300kb queries) in the the browser's memory. What are the unseen benefits, risks associated with this? var response = JSON.parse(xhr.responseText); Cache.push(response); // Store parsed J...

Content negotiation and HTTP headers in PHP

This is a following to my yesterday question: http://stackoverflow.com/questions/1975416/trying-to-understand-the-vary-http-header I have a .php that can be served with different MIME types. To do this I use "Vary: Accept" HTTP header (which is confirmed to be correct). But what if the same document (with the same URL) can be served in ...

Is my PHP script cache (public) friendly?

I have finalized a small PHP application that can serve many documents. These documents must be cacheable by clients and proxies. Since proxies can cache my results I must be extra careful because the documents I serve can have different MIMEs types (content negotiation based on $_SERVER['HTTP_ACCEPT']) and different languages (based in...

joomla performance

hi i had a very noob question for site speed point of view which method is more effective caching or reducing http request .I am using smartoptimizer for the caching ,Gzip and for minify purpose , I have a doubt in my mind related with caching issue ,which one is best default joomla cache or smartoptimizer when i used both i got 404 er...

How can I prevent some of my views in ASP.NET MVC from being cached?

I have a view that shows a list of items and when you click on one of them it will take you to the items page. I also store a "Viewed" flag in the database for that item. Now, when the user clicks back, the item should be styled differently because of the change in the "Viewed" flag. However, every time I click back, it is as it was b...

performance counter events associated with false sharing

hi I am looking at the performance of OpenMP program, specifically cache and memory performance. I have found guidelines while back ago how to analyze performance with Vtune that mentioned which counters to watch out for. However now cannot seem to find the manual. If you know which manual I have in question or if you know the counters...

How can I have Google App Engine clear memcache every time a site is deployed?

The title asks it all. The content on the site I'm building wont change very quickly at all and so Memcache could potentially store data for months except for when I put up an update. Is there a way to make it clear the cache every time I deploy the site? I'm using the Python runtime. Update 1 Using jldupont's answer I put the followin...