Skip to main content

Posts

Showing posts with the label caching

Why all my files are not cached with apc op code?

I'm using APC (3.1.9) and Zend Framework, however, only a bunch of file are being cached (something like 10 / 400).

Android take screen shot programatically

First off i am writing a root app so root permissions are no issue. I've searched and searched and found a lot of code that never worked for me here is what i've pieced together so far and sorta works. When i say sorta i mean it makes an image on my /sdcard/test.png however the file is 0 bytes and obviously can't be viewed. public class ScreenShot extends Activity{ View content; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.blank); content = findViewById(R.id.blankview); getScreen(); } private void getScreen(){ Bitmap bitmap = content.getDrawingCache(); File file = new File("/sdcard/test.png"); try { file.createNewFile(); FileOutputStream ostream = new FileOutputStream(file); bitmap.compress(CompressFormat.PNG, 100, ostream); ostream.close(); } catch (Exception e) { e.printStackTrace(); } } } Any h

Cache (static) content from other website on my own webserver

My website is loading slowly and I ran this test: http://www.webpagetest.org/result/120227_MD_3CQZM/1/performance_optimization/ Which indicates that files stored on gametrackers.com is not being cached. Apache and joomla already cache content that is on my server. I'm using a script from gametrackers.com to show my teamspeak 3 statistics on my website 1 However this script sometimes loads slowly duo to issues with gametrackers.com server and that's why I'd like to store a copy of it on my own webserver as cache and refresh it every 30 minutes from the gametrackers website. If the gametrackers website is down(which is quite common) it should keep the last successful cache check. How would I do this with apache 2.4.1 and possibly php? If its possible I'd also like to use css sprites because webpagetest.org indicates: The following images served from gametracker.com should be combined into as few images as possible using CSS sprites. http://cache.www.gametrack

Jersey Client: Cache-Manager for Conditional GET?

Jersey has wonderful support for server-side handling of Preconditions to respond to a Conditional-GET-request. On the client-side it seems a bit less elegant/manual. As far as I know you'd need to store the metadata of the entity yourself (etag, last-modified header) and make a decision, when to set which headers, evaluate the response code, update your local cache of entity/metadata ... etc. Do you know of a ready, free implementation that wraps up the conditonal GET? I found this example , where the poster is using CacheManager and CacheEntry ; I suspect his own implementation. Shouldn't this be part of Jersey Client itself?

Iphone runs ONLY from cache even when online

I am having a bit of trouble. I am making a mobile version of our website, and want to cache some of the more important pages, not just for use offline, but for added speed in some cases. First question: Do I have to manually cache the pages to speed up performance? I am using AJAX calls to bring in content, and it obviously doesn't work offline without manually caching, but while online is Safari going to request a page via ajax if it's already in the cache? I currently have it working correctly. My pages cache and work both online and offline. But if I don't specify all pages I want cached, it appears with every ajax call, those pages are requested again, not loaded from cache. Second Question (My actual problem): When online or offline, and using a .manifest file to manually cache files, it appears that the iPhone sets itself in a "offline" mode, even when online. So when I run my ajax call, if the page is not cached, I get an error. $.ajax({ url: p

DiskStore .throwableSafeExpireElementsIfRequired(620) org.appfuse.model.User Cache: Could not expire elements from disk due to null

I am facing above exception followed by OutOfMemoryException. JVMDUMP013I Processed Dump Event "systhrow", detail "java/lang/OutOfMemoryError". ERROR [Store org.appfuse.model.User Spool Thread] DiskStore.throwableSafeExpireElementsIfRequired(620) | org.appfuse.model.User Cache: Could not expire elements from disk due to null. Continuing... java.lang.OutOfMemoryError at java.util.Collections$SynchronizedMap . values (Unknown Source) at net.sf.ehcache.store.DiskStore . expireElements at net.sf.ehcache.store. DiskStore . Exception in thread "QuartzScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError at java.lang.String.<init>(String.java:364) at org.quartz.Trigger.getFullName(Trigger.java:435) at org.quartz.simpl.TriggerComparator.compare(RAMJobStore.java:1408) at java.util.TreeMap.find(Unknown Source) at java.util.TreeMap.remove(Unknown Source) at java.util.TreeSet.remove(Unknown