Re: highest traffic cakePHP 1.2 sites?

2010-01-08 Thread Dave J
I can attest to that. We built a site fully on Cake which gets over 40-50 thousand uniques a day without breaking a sweat. The highest load we've seen was Cake serving out around 200 pages per second. Using view caches wisely and unbinding unnecessary models always help. If you have high traffic

Re: Cache Race conditions, any solution available ?

2009-12-22 Thread Dave J
I think you pretty much got it right there. The simplest way would be to set the timeout like you said, in the far future, and then have a cron job in the background calling the Cake console (or special URL), which does the real request and sets the cache value. That would effectively reduce the

Re: Counting views of cached pages

2008-11-10 Thread Dave J
page. However, note that you'll have to be careful about any other work done in the beforeFilter and any Components you load, as all these will be initialised as well. Simonhttp://www.simonellistonball.com On Nov 9, 2:21 pm, Dave J [EMAIL PROTECTED] wrote: This may not be the cleanest

Re: Counting views of cached pages

2008-11-09 Thread Dave J
This may not be the cleanest solution, but here goes. It's a sort of 'web-bug' approach. You could have an action in your controller (or a separate controller dedicated to statistics) which will do the counting for you, and then invoke it with an img tag in the view. So for example, you can

Re: Cake 1.2 is slow (4s...)

2008-11-06 Thread Dave J
Are you using any op-code caches (APC, eAccelerator or XCache) ? On Nov 6, 11:53 am, Remigijus [EMAIL PROTECTED] wrote: I have set debug mode to zero. But still framework uses Memory used: 5.42 MB And loads about 1 sec. I have done some benchmarks, and without models loaded, site uses

Re: database is utf-8, page is utf-8, but i get weird characters

2008-11-02 Thread Dave J
Not sure why it would show up as a question mark when you generate the form with the helper, however, when connecting to the database, make sure you set the encoding as well. var $default = array('driver' = 'mysql', 'host' = 'localhost', 'login' =

Re: Using requestAction() on a hidden method i.e. _navigation()

2008-10-12 Thread Dave J
Cristof's suggestion works as well, and will keep the code clean as well. As an alternative to your question, you can always cache queries in your Categories model, so that the overhead in getting the categories will be negligible. function getCategories() { $categories =

Re: Using requestAction() on a hidden method i.e. _navigation()

2008-10-10 Thread Dave J
Why not simply get the categories in AppController, and set them to something like $siteNavigation, so that's it available to all pages (including elements). $this-set('siteNavigation', $this-Categories-find(...)); It also removes the extra overhead of requestAction. Just remember to include

Re: Caching help

2008-09-10 Thread Dave J
Hi Kenchu, I'm almost sure this is a hack, but it's been working fine for me so far. If you want your variables to persist in the cached views, set them like this: $this-data['variableName'] = 'variableValue'; You can have a look at the created cached files in the tmp directory to see what

Re: HABTM cascading delete

2008-08-20 Thread Dave J
I dont think it works for HABTM relations also for the reason that it might be unsafe to do so. By deleting all related records, you might also be deleting records which are referenced to by other entries in the join table. On Aug 20, 4:03 am, Marcello [EMAIL PROTECTED] wrote: it does not

Re: HABTM cascading delete

2008-08-20 Thread Dave J
the job just as well. On Aug 20, 2:44 pm, Dave J [EMAIL PROTECTED] wrote: I dont think it works for HABTM relations  also for the reason that it might be unsafe to do so. By deleting all related records, you might also be deleting records which are referenced to by other entries in the join

Re: Image Helper memory usage fatal error

2008-07-08 Thread Dave J
Just throwing it out there but what if the helper was modified to use ImageMagick from the commandline, instead of GD? In my experience, ImageMagick is a lot more capable in handling large images (not to mention, it uses its own memory space, instead of PHP's). Also, it can handle pretty

Re: Problems displaying an image from a controller action using readfile()

2008-05-25 Thread Dave J
Hi Lauren, that code that you're using should work fine, in fact I've tried it on this end, and it works perfectly. The only thing that comes to mind at this point, is to check your controller file (or any file in your app folder), and check for extra carriage returns at the very end of the

Re: Problems displaying an image from a controller action using readfile()

2008-05-24 Thread Dave J
Hi Lauren, try setting $this-autoRender = false (instead of setting the layout to empty), this way Cake won't send anything out to the browser. also, you might want to try: header('Content-Type: image/jpeg'); (notice the 'jpeg' instead of 'jpg') See if that helps Dave On May 23, 9:52 

Re: cache issues

2008-04-10 Thread Dave J
Hi Ron, Usually adding $this-disableCache(); to the beforeRender() sends the correct headers to the browser so it won't cache the pages. However if you're using Cake's View caching, you'll soon find out (and rightly so) that no code from the Controllers gets executed after the first hit. We

Re: cache issues

2008-04-10 Thread Dave J
a cached version stored. On Apr 10, 10:30 am, Dave J [EMAIL PROTECTED] wrote: Hi Ron, Usually adding $this-disableCache();  to the beforeRender() sends the correct headers to the browser so it won't cache the pages. However if you're using Cake's View caching, you'll soon find out (and rightly

Re: ajax question: how can I make the controller decide what element to update?

2008-03-26 Thread Dave J
Hi Marc, What if the view is actually a Javascript codeblock which updates the DOM? (Since Ajax responses are evaluated in they contain script tags) For example, the response view might only contain $('form_div').update('Hello'); or $('listing_div').update('Hello'); I haven't tried this

Re: Login box in layout

2008-03-23 Thread Dave J
Timchenko [EMAIL PROTECTED] wrote: Yeah, I was trying it, but that way I lose any data according to validation/authentication errors. Is there any solution? Regards, Nick Dave J wrote: How about in the action which processes the form data, you pick up the referer URL  ($this-referer

'object_map' entry in core Cake caches

2008-03-05 Thread Dave J
Hi everyone, just a little curious thing I noticed today while looking at the cache entries. One of them is called 'object_map', which is created by the Configure class and seems to contain an array with the entire list of Controllers in the project. It seems like this entry is being written to

Re: Data historic or journal with Cake

2008-01-16 Thread Dave J
Hey guys, I was just thinking about this yesterday. I have by no means done any research on this at all, so... just throwing it out there What about a journal table (fieldnames: id, model_name, model_id, data)? And before saving a record with the updated values, you save a serialized array of

Re: web 2.0 concepts

2007-12-24 Thread Dave J
http://en.wikipedia.org/wiki/Web_2.0 On Dec 24, 8:49 am, venki [EMAIL PROTECTED] wrote: Hi, What is web 2.0 ?What is the use of web 2.0 concepts? Please tell me some examples and how we will use web 2.0 concepts in my coding. Please send me the example web 2.0 websites Regards, Venki

Re: Session problem ....

2007-12-18 Thread Dave J
hi stefan, just a quick question cos I have just ran into this problem about an hour ago. are you using the latest nightly or the 5875 release? Cos i'm having problems with the session not storing anything in the latest nightly... and going back to the pre-beta release fixed it. I'm still

Re: Few questions from a Cake newcomer...

2007-12-17 Thread Dave J
telling me i'm on the Links page.. but the layout only handles variables for the title and main content. The layout will display any variable that has been passed on to the views, not just the ones for title and main content. Once you set a variable using $this-set('variable','value'), it

Re: Different layout for function (not controller)

2007-12-09 Thread Dave J
Or how about utilizing the beforeRender in the main AppController? function beforeRender() { if (!empty($this-params['admin'])) { $this-layout = 'admin_layout'; } } saves you having to set the layout for each admin method in all the sub-controllers On Dec 9, 8:02 pm, websta*

Re: Caching the view of the entry homepage

2007-12-04 Thread Dave J
Thanks for the replies. I ended up settling for the redirect option for the short term fix. @Adam: Neat workaround, wish I thought about it earlier... just not the right time to start splitting down the homepage into elements right now :-) @Matt: I can understand your pain, especially the

Caching the view of the entry homepage

2007-12-03 Thread Dave J
Hi guys, I've been having issues with caching the view of the homepage, and previous posts regarding the subject ( http://groups.google.co.uk/group/cake-php/browse_thread/thread/2f005c48b785426a/5019bc5f68475195 ) only seem to have come up with workarounds involving redirecting from the htaccess

Re: Hit logging in Cake

2007-11-18 Thread Dave J
You also need to take into consideration if you'll be using view caching or not. As far as I know, once a view has been cached, beforeRender() won't be called on anymore. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: $File-write problems in new release?

2007-10-24 Thread Dave J
Hey gwoo... thanks for the pointer. In fact that was exactly the problem. line 223 in /libs/file.php: $data = strtr($data, array(\r\n = $lineBreak, \n = $lineBreak, \r = $lineBreak)); It inserts line endings regardless of the filetype, corrupting any binary data in the process. I'll open a

$File-write problems in new release?

2007-10-23 Thread Dave J
Is anyone who uses the File class to write binary (etc images) data getting file corruption in the new pre-beta release? I haven't been able to pin down the cause just yet, but it seems to be something that changed between a couple of weeks ago (that's the last nightly i got), and yesterday's

Re: cake deployer

2007-10-04 Thread Dave J
Hi Dan, here's basically the commands that would do a basic deployment using SSH/SVN. I'm currently rewriting the whole thing as a console script for cake, so to keep the deployment script as part of the main project (relying only on svn and rsync as external libraries). What needs to be noted

Re: webroot shows in http url

2007-08-20 Thread Dave J
Hey Matt, check your Apache http.conf file... make sure that DocumentRoot is pointing to the /cake/app/webroot dir On Aug 20, 6:31 am, Matt [EMAIL PROTECTED] wrote: I put some scaffolding together for a small project. I used bake: -project projectname -app projectname and created MVCs

Re: ACL (again) in 1.2

2007-05-20 Thread Dave J
ah sweet! thanks man. I'm just very torn right now between the working ACL in 1.1 and all the goodie features of 1.2 (the new FormHelper and the Set class by themselves are enough!). And wondering if its worthwhile biting the bullet and trying to figure out how it works in 1.2 (which would be

Re: othAuth Performance

2007-05-15 Thread Dave J
to the session. but yea to each his/her needs On May 14, 7:17 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/14/07, Dave J [EMAIL PROTECTED] wrote: My question is this. as it is right now... I'm using CakePHP's admin routing functions to implement the admin actions (ie. the admin

othAuth Performance

2007-05-14 Thread Dave J
Hi guys, I've just started using CakePHP a couple of weeks ago and so far I'm beyond impressed with its flexibily and simplicity. I'm currently implementing othAuth for the administration pages of the app and so far its been great and works fine. My question is this. as it is right now...