How does standard Wurfl cache - looking into the memory foot

I don't get it, <device> X has no capabilities in it!!!!
johnmarson
Posts: 1
Joined: Wed Apr 24, 2013 6:32 am
Contact:

How does standard Wurfl cache - looking into the memory foot

Postby johnmarson » Wed Apr 24, 2013 6:33 am

Just a quick one, can find anything online.

Im looking into using Wurfl for a UserAgent lookup system.

I need some insight into how it caches, now the file comes as one 15.9 meg XML and as I understand it when using APC to cache that it transforms that into an PHP array. However when using the ZIP it creates a directory structure using MD5 hashes as filenames for each individual device (stored as a serialized object).

Now when a request comes in does go away and traverse the cache directories for the right device and then cache that entry only or does it cache the whole filesystem and then lookup on that.

I think I have a pretty good idea of what it does as the alternative sounds counter productive but I'm just looking for confirmation.

Cheers

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: How does standard Wurfl cache - looking into the memory

Postby kamermans » Mon Apr 29, 2013 10:13 am

First, there are two types of storage that the PHP API uses, Persistence and Cache.

The Persistence layer takes the WURFL.XML file and puts it in a format that PHP can easily consume, like files or APC objects. When uncached requests are made to the API, it will look for the matching device in the persistence storage area.

The Cache layer caches those responses from the Persistence layer, and when a memory-based cache provider like APC is used in front of a file-based Persistence layer, it also caches the persistence data since it is much, much faster. Because of this optimization, using File-based persistence with memory-based caching (APC or Memcache) is the recommended configuration. It is not recommended to use APC or Memcache for Persistence because if a device entry is pushed out of memory, the API will start throwing exceptions.

There is no difference in the way the XML is stored vs. the ZIP file. There must have been some configuration difference in your code that caused the XML to load differently than the ZIP.

Does this help?
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 6 guests