Re: highest traffic cakePHP 1.2 sites?
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 sites, it's advisable to have static files like images and stylesheets being served out by a smaller server (like Lighttpd), even on the same machine, and leave Apache to do the heavy lifting with Cake/PHP. On Jan 8, 1:30 pm, Chad Smith wrote: > Hey, > > Well I have a few things to throw in here both from my own work and > from my previous employer's. > > CountyCriminal -http://www.countycriminal.comgets about 100 uniques > an hour, and it's built with Cake 1.2/jQuery. Also all of the KML > mapping is ran through cake so there's that as well. > > IdentityAlert -http://www.identityalert.org- Gets about 40 uniques a > day so it's not terribly busy but it's built on cake 1.2/jquery as > well. > > The Easy API -http://www.theeasyapi.com- Hasn't went live yet but > when it does I anticipate that it will get a good bit of traffic > because of what it does. It provides one common API interface that > will interface with a lot of other API's and act as a middleman > between them. No need to setup your server differently to access an > API, no need to read sometimes really poorly written documentation to > find out the documentation is old and it doesn't work. The Easy API > takes care of all of that and then some. Oh, and it's Free. Go sign- > up for an account today. That part works at least. I should have > that finished completely in about 2 weeks. I know some shameless > promotion but I have to start somewhere right? > > I'll be excited to see who else throws in some bigger sites than my > little ones, but I can tell you that with my previous employers we > have sites in the 1000k+ range that is using Cake 1.2 and they are > operating beautifully. > > On Jan 8, 7:33 am, keymaster wrote: > > > This is not meant to be a post on "evaluating cake's performance" or > > anything like that. I use cake alot and have no issues. > > > I also know that for those who utilize cake 1.2's various features for > > performance optimization to the fullest, there are very few issues of > > performance remaining even for the busiest apps. > > > So, this is really just a curiosity question. The kind of thing one > > thinks about when one doesn't feel like working :-) > > > By chance, does anyone have a feel for which sites (other than > > addons.mozilla.org which is cakePHP1.1 anyways) might be among the > > highest traffic'ed cakePHP 1.2 sites ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Cache Race conditions, any solution available ?
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 database requests to only the necessary ones every N minutes. So you would be in 'control' of populating the cache, and not the visitors On Dec 21, 9:38 pm, Adrenalin wrote: > Here is the problem > "Say you cache the latest five comments for display on a sidebar in > your application. You decide that the data only needs to be refreshed > once per minute. However, you neglect to remember that this sidebar > display is renderred 50 times per second! Thus, once 60 seconds rolls > around and the cache expires, suddenly 10+ processes are running the > same SQL query to repopulate that cache. Every time the cache expires, > a sudden burst of SQL traffic will result. " > (sourcehttp://code.google.com/p/memcached/wiki/FAQ) > > Any solution already made ? I was a bit disappointed cakephp didn't > offered a solution "by default".. Or I was unable to find it's already > there. > > Here's one proposed by the same FAQ > > "First, set the cache item expire time way out in the future. Then, > you embed the "real" timeout serialized with the value. For example > you would set the item to timeout in 24 hours, but the embedded > timeout might be five minutes in the future. > > Then, when you get from the cache and examine the timeout and find it > expired, immediately edit the embedded timeout to a time in the future > and re-store the data as is. Finally, fetch from the DB and update the > cache with the latest value. This does not eliminate, but drastically > reduces the amount of time where a stampede can occur. " > > If I would like to implement that in the existing Cache::write, what > would be the right thing to do ? > > Thank you. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Counting views of cached pages
A that's a much cleaner solution I must say. Definately didn't know about that one. Good stuff. I agree with Simon though, you need to still be careful on what happens in the beforeFilters, especially if any of them make additional calls to the Models. On Nov 10, 8:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Another, more cake based way of doing this, would be to use a > beforeFilter, and set the (broadly undocumented at present): > > var $cacheAction = array('duration'=>'1 day','callbacks'=>true); > > in your controller. This will add calls to the before filter in your > cached 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 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 tag in the view. > > > So for example, you can have > > /articles/addviewcount/ > > > which would echo the contents of an empty gif image. > > > And then in the view, you can put something like > > > > > That way, the addviewcount action will be called, regardless if the > > view was cached or not. > > > Just remember to turn off view caching for the addviewcount action. > > > On Nov 9, 12:05 pm, Filip Camerman <[EMAIL PROTECTED]> wrote: > > > > In some controller actions I do an UPDATE table SET nviews = nviews + > > > 1 WHERE id = '{$id}' to keep track of how often the page gets viewed > > > (for each record). Now I want to cache some of these actions, and I > > > was wondering what would be the best way to keep counting pageviews. > > > The first way I can think of is to put nocache tags in the view around > > > a requestaction that would do the update query, but that would be a > > > "dirty" way to do it. Maybe something with a before filter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Counting views of cached pages
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 tag in the view. So for example, you can have /articles/addviewcount/ which would echo the contents of an empty gif image. And then in the view, you can put something like That way, the addviewcount action will be called, regardless if the view was cached or not. Just remember to turn off view caching for the addviewcount action. On Nov 9, 12:05 pm, Filip Camerman <[EMAIL PROTECTED]> wrote: > In some controller actions I do an UPDATE table SET nviews = nviews + > 1 WHERE id = '{$id}' to keep track of how often the page gets viewed > (for each record). Now I want to cache some of these actions, and I > was wondering what would be the best way to keep counting pageviews. > The first way I can think of is to put nocache tags in the view around > a requestaction that would do the update query, but that would be a > "dirty" way to do it. Maybe something with a before filter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake 1.2 is slow (4s...)
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 2.6MB memory, with empty model (and set param > useTable to null, and recursion to -1) it uses 5.42. Where is the > problem, please help me ;( > > On Nov 6, 1:12 pm, Ziobe <[EMAIL PROTECTED]> wrote: > > > Just to say that my cakephp project is blank. > > And even if i try to change the debug, the problem is still here --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: database is utf-8, page is utf-8, but i get weird characters
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' => 'username', 'password' => 'pass', 'database' => 'database_name', 'encoding' => 'utf8' ); On Nov 2, 2:32 pm, bartvh <[EMAIL PROTECTED]> wrote: > My MySQL5 database is encoded in utf-8, and the page is as well (which > is declared in the html meta tags), however when I generate a select > field with the form helper, an uncommon character (é to be precise) > shows up as a question-diamond in firefox. if i manually set firefox > to use western (iso-8859-1) the character shows up fine. > > what goes wrong here? > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using requestAction() on a hidden method i.e. _navigation()
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 = Cache::read('categories'); if (empty($categories)) { $categories = $this->find('all'); Cache::write('categories', $categories, '1 hour'); } return $categories; } On Oct 10, 4:24 pm, "Christof Damian" <[EMAIL PROTECTED]> wrote: > 2008/10/10 MikeB <[EMAIL PROTECTED]>: > > > > > Good point. I'm all for following best-practices. However, what if, > > for examples sake, I didn't need to include the navigation in every > > page? I would be wasting time querying/compiling a list of categories > > that wouldn't be accessed in the view. > > Write a CategoryController class and make the classes which need the > categories child classes of this one. There is no need to have it in > AppController. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using requestAction() on a hidden method i.e. _navigation()
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 the Categories model in AppController. On Oct 9, 2:10 pm, MikeB <[EMAIL PROTECTED]> wrote: > I need to be able to create a navigation used across my site on many > pages. This particular navigation is table-driven from the categories > table. It seems like using requestAction() of the categories > controller in an element, navigation.ctp, would be the perfect > solution. > > I got all that to work fine, but it occurred to me that I would > probably need to make the navigation() action hidden, i.e. > _navigation(). However, when I try $this->requestAction('/categories/ > navigation') it gives me a 'max nesting level' error. I tried changing > the param to '/categories/_navigation' but that had no change. > > Here is the exact error: > Fatal error: Maximum function nesting level of '100' reached, > aborting! > > Any thoughts? Am I going about this the wrong way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Caching help
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 Cake is doing. At the very top, there's a list of variables which are persistent for that cache. On Sep 9, 2:27 pm, Kenchu <[EMAIL PROTECTED]> wrote: > http://book.cakephp.org/view/347/Marking-N...ontent-in-Views > > In the link above they've got a cached page, but still within the > tags they access a variable called $newProducts. How is > that possible? I've been trying to use the $this->set([...]) function > in the action, beforeFilter and in the __construct, but none of them > worked. Neither the action im caching or beforeFilter would run. Why > putting it in the construct didnt work I dont know. > > So how do you send data to a nocache tag within a cached page? > > I also wonder if it's possible to keep acachefor a whole day without > it being updated, even though new posts and updates occur in the > database. According to: > > http://book.cakephp.org/view/348/Clearing-the-Cache > > thecacheis cleared for this. I don't want it to be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM cascading delete
Not sure if I made sense in my previous post, but basically this is a case in which, if you're in a situation where you need to delete dependent records in an HABTM relationship. you might need to think if the relationship should be an HABTM one at all... or if a simpler hasMany would do 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 table. > > On Aug 20, 4:03 am, Marcello <[EMAIL PROTECTED]> wrote: > > > it does not work (gives no error, but does not remove the dependent > > side) > > > On 19 ago, 22:26, Marcello <[EMAIL PROTECTED]> wrote: > > > > dependent is exactly what i was looking for > > > > thanks! > > > > On 19 ago, 22:11, Joel Perras <[EMAIL PROTECTED]> wrote: > > > > > Take a look athttp://book.cakephp.org/view/66/models#deleting-data-516 > > > > . The 'dependent' parameter can also be set in the model association > > > > definition. > > > > > Hope that's what you were looking for. > > > > -J. > > > > > On Aug 19, 8:52 pm, Marcello <[EMAIL PROTECTED]> wrote: > > > > > > i got 2 tables linked by a HABTM relationship > > > > > > when i delete table record 1 i want to delete the relationship with > > > > > table and the table 2 record as well > > > > > but when i delete from table 2 i want to keep table 1 record > > > > > > is there any feature in cakephp for cascading in habtm? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM cascading delete
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 work (gives no error, but does not remove the dependent > side) > > On 19 ago, 22:26, Marcello <[EMAIL PROTECTED]> wrote: > > > dependent is exactly what i was looking for > > > thanks! > > > On 19 ago, 22:11, Joel Perras <[EMAIL PROTECTED]> wrote: > > > > Take a look athttp://book.cakephp.org/view/66/models#deleting-data-516 > > > . The 'dependent' parameter can also be set in the model association > > > definition. > > > > Hope that's what you were looking for. > > > -J. > > > > On Aug 19, 8:52 pm, Marcello <[EMAIL PROTECTED]> wrote: > > > > > i got 2 tables linked by a HABTM relationship > > > > > when i delete table record 1 i want to delete the relationship with > > > > table and the table 2 record as well > > > > but when i delete from table 2 i want to keep table 1 record > > > > > is there any feature in cakephp for cascading in habtm? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Image Helper memory usage fatal error
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 much any image format you can throw at it. On Jul 8, 7:57 pm, francky06l <[EMAIL PROTECTED]> wrote: > Well try with smaller images. Also what is your memory_limit set in > php.ini ? > Maybe try an ini_set('memory_limit', xxMb), before calling the > resizing .. > > On Jul 8, 3:29 pm, clrockwell <[EMAIL PROTECTED]> wrote: > > > Thanks francky06l - I am actually using rc2, sorry for the typo. > > > The images were originally as large as 3M, but I have resized them all > > down to less than 2MB and the issue still occurs. I also re-exported > > them as jpg as they were originally exported with cmyk color. The > > issue is less prevalent, but still occuring. I am starting to think > > the root of the problem is a virtual memory issue on the vps side of > > things. > > > I appreciate any direction or shared experience anyone has with this. > > > Thanks for any direction > > > On Jul 7, 5:38 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > You should use rc2 ;-) > > > By the way, what is theimagesize you try to resize ? > > > > On Jul 7, 3:34 pm, clrockwell <[EMAIL PROTECTED]> wrote: > > > > > Hello All, hoping someone can point out the why I keep getting a > > > > memory error at line 59 ofimagehelper, it is using a ridiculous > > > > amount of memory. > > > > > Thehelperis posted here:http://bin.cakephp.org/view/859527090 > > > > > Using nightly build 6296 (just grabbed it yesterday), cakephp 1.2 rc1 > > > > > Thanks much for any insight you can provide. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems displaying an image from a controller action using readfile()
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 file (after the ?> closing tag), which might be screwing things up because they get sent to the browser before the headers, messing up the image. On May 25, 4:30 pm, lauren49 <[EMAIL PROTECTED]> wrote: > Tried $controller->disableCach() which adds the following headers: > > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); > header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); > header("Cache-Control: no-store, no-cache, must-revalidate"); > header("Cache-Control: post-check=0, pre-check=0", false); > header("Pragma: no-cache"); > > Didn't work:\ > -- > View this message in > context:http://www.nabble.com/Problems-displaying-an-image-from-a-controller-... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems displaying an image from a controller action using readfile()
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 pm, lauren <[EMAIL PROTECTED]> wrote: > Hi, > > So I've had this working perfectly. The images are stored above the > webroot > > /app > /uploads > img01.jpg > > The controller has an action which accepts the file name of the image, > adds some HTTP headers and outputs the image contents using > readfile(). > > Now I can't be 100% sure but it seemed to start happening after I > enabled Cake's caching feature. However, I've since disabled it but > the problem remains. > > I've spent a few hours debugging this and here is what I've come up > with so far: > > I can get the images to display correctly in my browser with a simple > test script (no Cake) containing the following code: > $file = 'path/to/img001.jpg'; > header('Content-Type: image/jpg'); > header('Content-Length: ' . filesize($file)); > readfile($file); > > So to me that rules out Apache or PHP as potential culprits. > > > The HTTP headers from my test script > http://localhost/test.php > > GET /test.php HTTP/1.1 > Host: localhost > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: > 1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 > Accept: text/xml,application/xml,application/xhtml+xml,text/ > html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip,deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive: 300 > Connection: keep-alive > > HTTP/1.x 200 OK > Date: Fri, 23 May 2008 19:47:02 GMT > Server: Apache/2.2.3 (Win32) PHP/5.2.0 > X-Powered-By: PHP/5.2.3 > Content-Length: 2116 > Keep-Alive: timeout=5, max=100 > Connection: Keep-Alive > Content-Type: image/jpg > -- > > > The HTTP headers from the request in Cake: > http://devel.domain.com/controller/displayFile/4/2.jpg/thumb > > GET /controller/displayFile/4/2.jpg/thumb HTTP/1.1 > Host: devel.domain.com > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: > 1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 > Accept: text/xml,application/xml,application/xhtml+xml,text/ > html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip,deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive: 300 > Connection: keep-alive > Cookie: CAKEPHP=crtafp53f202pombn3cmj83og5 > > HTTP/1.x 200 OK > Date: Fri, 23 May 2008 19:48:03 GMT > Server: Apache/2.2.3 (Win32) PHP/5.2.0 > X-Powered-By: PHP/5.2.3 > P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" > Content-Length: 2120 > Keep-Alive: timeout=5, max=99 > Connection: Keep-Alive > Content-Type: image/jpg > -- > > I've tried removing the P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP > IND DEM" but that didn't solve the problem. > > Also, here a stripped version of the code in the controller's > displayFile() action: > > function displayFile($id, $file_name, $type=null) { > Configure::write('debug', 0); > session_destroy(); > $this->layout = ''; > > header('Content-Type: image/jpg'); > header('Content-Length: ' . filesize($file)); > readfile($file); > exit; > > } > > I'm hoping someone can shed some light... > > - Lauren --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cache issues
The main issue here is the difference between the Cake caches and the browser caches. You still want the Cake caches fully enabled, however (especially for sites which frequently change their content, such as news sites), you dont want the browser to keep a cached copy of the page, or viewers might end up seeing stale pages. "Configure::write('Cache.disable', true);" doesn't have any effect on the browser cache at all, just the Cake ones. Just make sure you send the correct headers. On Apr 10, 10:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > You should try this directive in config/core.php. It is supposed to > turn off all caching. > Configure::write('Cache.disable', true); > It is on line 71 (or close by) but commented ut. > > Also make sure that you really really make the browser drop its cache > too. It is not enough to disable the cache in Cake if the browser > already has 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 so) that no code from the Controllers gets executed after the > > first hit. We worked around this by putting the following lines in the > > main layout. > > > > > > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); > > header("Pragma: no-cache"); > > ?> > > > > > Has anyone come across this or came up with a cleaner solution? > > > On Apr 9, 6:26 pm, Ron Astonvarga <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I have an issue with caching. > > > > I have cache switched off ( Configure::write('Cache.check', true); // > > > in core.php ) > > > > But my actions are still cached and I need to click on refresh every > > > time I want see the results of the action. > > > I tried to add > > > > > > > > > > > to header of xhtml file, but this doesn't help too. > > > > thanks for any idea > > > (running today's nightly build, tried 1.2.0.6311 from 01/02 too) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cache issues
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 worked around this by putting the following lines in the main layout. Has anyone come across this or came up with a cleaner solution? On Apr 9, 6:26 pm, Ron Astonvarga <[EMAIL PROTECTED]> wrote: > Hello, > > I have an issue with caching. > > I have cache switched off ( Configure::write('Cache.check', true); // > in core.php ) > > But my actions are still cached and I need to click on refresh every > time I want see the results of the action. > I tried to add > > > > > to header of xhtml file, but this doesn't help too. > > thanks for any idea > (running today's nightly build, tried 1.2.0.6311 from 01/02 too) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ajax question: how can I make the controller decide what element to update?
Hi Marc, What if the view is actually a Javascript codeblock which updates the DOM? (Since Ajax responses are evaluated in they contain
Re: Login box in layout
Hey Nick, You're right about that. I guess you can tackle it either two ways. 1) Submit the form using AJAX, so if there's any errors, you get them back without a page refresh. And on successful login, you could either hide the login form and replace it with a 'logged-in' message. Or send back a JS command to refresh the page, so the page would reflect the new logged-in status 2) Or use the flash feature of the Session Component/Helper to return any errors as soon as the page refreshes. (Just make sure you have $session->flash() somewhere in your layout) On Mar 23, 8:00 pm, Nick 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() ) and at the end - after the user > > successfully authenticates - you just redirect to that URL > > basically leaving him on the same page. > > > Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
'object_map' entry in core Cake caches
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 the cache pretty much on every request, even with a TTL of 1 hour. I'm almost sure the performance hit is negligible... but perhaps maybe someone else noticed it. Or if looks like it might need to be filed as a bug. Running on cake beta 6311 using APC as the cache. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Data historic or "journal" with Cake
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 the existing record values in the journal table? That way you can view a history of any record, and maybe even use something like phpdiff to see the differences stupid idea or? On Jan 16, 2:42 pm, Adam Royle <[EMAIL PROTECTED]> wrote: > I am also interested in something like this. The tricky thing for me > to understand is how associations would be stored as well. Ideally it > would be great to be able to see a history of models and their > associated models without overwriting the "HEAD" revision. My > reasoning behind this is to have an easy way to implement multiple > drafts of models, without having to rewrite my controllers/views much > (or at all). This functionality could be used in a CMS for preview and > approval functionality. > > On Jan 16, 8:42 pm, francky06l <[EMAIL PROTECTED]> wrote:> Hi bakers, > > > I am wondering if someone already implemented an "historic" or > > "journal" with cake. Actually my need is to be able to keep trac of > > the changes on a record. > > Ideally, each modification would a journal_id and I could roll back > > the journal to restore the data at any points. > > I have been searching the MySql triggers for this, but seems that > > performances are affected a lot. > > I have written a "small" behavior for it, but I am not 100% satisfied > > with this. > > If you have experimented something, I would be glad to know how to > > handle this (maybe another DB is better?). > > > Another question; I haven;t check the code of the 1.2 beta for this : > > is the transactional mode fully implemented or I need a behavior for > > it ? > > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: web 2.0 concepts
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 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session problem ....
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 looking into it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Few questions from a Cake newcomer...
> 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 can be used both in the view and the layout itself --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Different layout for function (not controller)
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*" <[EMAIL PROTECTED]> wrote: > function admin_method(){ > $this->layout = "my_layout"; > > > } > -Original Message- > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf > > Of Dilbert > Sent: Monday, 10 December 2007 7:34 a.m. > To: Cake PHP > Subject: Different layout for function (not controller) > > I know it's possible to use a different layout for every > controller...But can I use a different layout for every function in > the controller? For example if I have an article controller with add/ > delete/edit/view function for normal users and admin_functions for > moderator can I use different layout for /admin sections? thank you. > > __ NOD32 2711 (20071207) Information __ > > This message was checked by NOD32 antivirus system.http://www.eset.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Caching the view of the entry homepage
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 homepage getting the most hits of the entire site, and being the only page not relying on a view cache.. hopefully will be sorted out soon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Caching the view of the entry homepage
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 The problem lies in cake not using the view cache when visiting www.domain.com, however, using www.domain.com/articles/index is just fine. I'm curious to see how people are doing this, since it seems this is a quite a substantial performance killer on high traffic sites. any ideas? PS: Using Cake 1.2.0.5875 here --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Hit logging in Cake
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 Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $File->write problems in new release?
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 ticket if that would help On Oct 23, 7:07 pm, Gwoo <[EMAIL PROTECTED]> wrote: > yeah, some changes were made for the line endings on the different OS. > Could you write a test case. The File tests are pretty easy to follow. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$File->write problems in new release?
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 pre-beta. I may be completely wrong, but just checking if anyone's encountered this yet before I open a ticket. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake deployer
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 is that you may need to setup public/private key authentication for SSH, so as the commands wont keep asking you for the password each time 1. svn export --force svn://svnserver/myproject /tmp/cakeproject 2. rsync -avz /tmp/cakeproject/ [EMAIL PROTECTED]:/project/location/on/ server 3. ssh [EMAIL PROTECTED] chmod -R 775 /project/location/on/server 4. rm /tmp/cakeproject Sorry if I may not be so clear, and i do realise that the process is a bit crude, but it gets the job done quick, and is quite reliable so far. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake deployer
Doesn't need to be so complicated. You could just use Cake's new console to make a script to export the HEAD revision to Cake's tmp directory, rsync to the target server (using '-avz' as options) and you're done. Then you could just add bells and whistles, like specifying which svn revision you want to deploy, but that's just small stuff. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: webroot shows in http url
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 and so on. Now when viewing the site I keep seeing > webroot show up in the url (i.e. example.com/webroot/articles/view/1 > instead of example.com/articles/view/1 > > Any idea of why this is happening. When I go to the second url it > works fine but I find after clicking on some links webroot shows up. > > They way I have cake setup is like this > \home\username\cake_install\ - cake 1.2.x.x > \home\username\projectname\ - document root (i.e. example.com folder) > > Any help would be greatly appreciated. > > BTW, cake is the best thing I've seen for php in a very long time. > Makes development fun againt :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Java applets and sessions
Hi everyone, Has anyone had any success in embedding Java applets in their Cake pages while still successfully holding on to a session? The reason is I'm using the JClientUpload applet (so people can upload files simply by dragging files onto the webpage). I've done some research and this has already cropped up before ( http://groups.google.com/group/cake-php/browse_thread/thread/62248f553b32eab8/ ), however it seemed like there wasn't a definite solution. And in that case it was just Safari that was the problem, however in this case it's affecting both Firefox and Explorer What's basically happening, is the applet is requesting for some resource files (images, settings) from the server, and for those requests, the UserAgent will change and Cake will (rightly so) assume it's a hijack attempt and will invalidate the session. Has anyone come across this before? The solutions I can come up with is... either (1) disable the Agent checking in session.php as was hinted in the other thread. but that's ugly. or (2) serve the applet directly, from outside the scope of cake thanks in advance for any input dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL (again) in 1.2
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 pointless if it's not working at all to begin with) much appreciated though :-) dave On May 19, 7:34 pm, algo <[EMAIL PROTECTED]> wrote: > Hello, Dave, > > I was lucky enough to get the answer from PhpNut in IRC, > citing it here (hope he won't object) > > [21:19] <[algo]> ACL are working or not ? > [21:19] <[algo]> 1.2 > [21:19] no he has not made it back yet, his flight left about > 1 hour ago > [21:19] <[algo]> just saw you in SVN HEAD rev, that's why I ask =) > [21:19] [algo] it is working in the latest svn > [21:20] <[algo]> cool > [21:20] [algo] you probably see my name in a lot of the > files ;) > [21:20] <[algo]> nowhere to read/get examples for new ACL right ? > (excepts sources) > [21:21] nothing yet > [21:21] <[algo]> I see ACL becomes sane in 1.2 > [21:21] there will be soon though > [21:21] and it will be better before I release 1.2 stable > [21:21] <[algo]> AXO ARO ACO just like phpgacl ? > [21:21] no > [21:22] <[algo]> is it possible to select products together with > access for current user ? > [21:22] <[algo]> like Product->findAll() > [21:22] <[algo]> but with access for current user > [21:22] <[algo]> to show edit/delete buttons if needed > [21:22] [algo] it will be possible > [21:22] <[algo]> but not yet ? > [21:23] [algo] it is but no docs on how to do it yet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL (again) in 1.2
I do realise that this topic comes up often and i have read and searched the group for answers and i'm at the point of trying to decide the best way to implement ACL. I'm just wondering if ACL in 1.2 works at all (doesn't matter if its not documented yet, i understand that completely), but just asking if the functionality is there - figuring out usage is another matter, but that's ok. any light on this issue would be very appreciated even a straight out "No! forget it" would do :-) dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: othAuth Performance
oh ok cool so really, the hit should be negligible. I'll do some benchmarking when i have progressed some more and see how it goes. thanks! On May 15, 4:51 pm, CraZyLeGs <[EMAIL PROTECTED]> wrote: > othAuth only does a session check, if the the action is public it > doesn't even go 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 > > > actions are sitting alongside the 'public' actions in the same > > > controller). Now, on a heavily visited site... does anyone have > > > experience regarding any slowdowns by using the othAuth component? > > > That's how I personally would do it. Keep the auth stuff for the > > areas that need it. > > > -- > > Chris Hartjes > > > My motto for 2007: "Just build it, damnit!" > > > @TheBallpark -http://www.littlehart.net/attheballpark > > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
othAuth Performance
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... I'm using CakePHP's admin routing functions to implement the admin actions (ie. the admin actions are sitting alongside the 'public' actions in the same controller). Now, on a heavily visited site... does anyone have experience regarding any slowdowns by using the othAuth component? What I'm trying to say is, if it would be recommened to create a seperate Admin controller (with the othAuth component), and leave the regular controller just for 'public viewing' purposes (without registering othAuth, and the associated beforeFilter() calls) - this from a purely performance point of view. Thanks in advance, I hope i explained it clear. dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---