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
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
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
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
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
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' =
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 =
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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*
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
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
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
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
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
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
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
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
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
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...
34 matches
Mail list logo