Re: Improve CuteNews Performance by Adding Page Caching

SO i checked out the 2 hacks. Only the approve hack adds something to index.php, and got nothing to do with headers.

<?php
header("Cache-Control: must-revalidate");
header("Pragma: cache");

$if_modified_since = preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']);

$mtime = filemtime("./cutenews/data/comments.txt");
$gmdate_mod = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';

if ($if_modified_since == $gmdate_mod) {
header("HTTP/1.0 304 Not Modified");
die();
}
header("Last-Modified: $gmdate_mod");
?>

I dont believe that this code goes into the cutenews index.php file but rather your websites main page. (index.php is the most common filename for the websites main page.)

Re: Improve CuteNews Performance by Adding Page Caching

i see... That makes sense to me.


Thanks

Re: Improve CuteNews Performance by Adding Page Caching

Hey, this is a good hack but I want it to refresh when I edit or delete something so I don't have to add a comment and delete to make it update again.

Thanks if you can help me. http://cutephp.com/forum/style_emoticons/default/smile.gif

29 (edited by 2008-01-09 23:10:15)

Re: Improve CuteNews Performance by Adding Page Caching

So does it work or not?
And what is the official code because I see it's been modified a lot.
Has anyone tested it?
And where exactly do you add the code?

Re: Improve CuteNews Performance by Adding Page Caching

No hack is official, that's why it's called a hack http://cutephp.com/forum/style_emoticons/default/smile.gif

To answer your question: don't know.

31 (edited by 2008-11-07 21:56:41)

Re: Improve CuteNews Performance by Adding Page Caching

Hi,

The final code is the one from post #7?

Re: Improve CuteNews Performance by Adding Page Caching

yep

Re: Improve CuteNews Performance by Adding Page Caching

yep


Ok, so i have to simply add the code from post #7 before

<?PHP

/***************************************************************************
 CuteNews CutePHP.com


to my script's main index.php file(the one which opens admin login page)?

Re: Improve CuteNews Performance by Adding Page Caching

yes

Re: Improve CuteNews Performance by Adding Page Caching

yes


It seems to be working, but how do I make sure?
By the way I have set filemtime path to ./data/comments.txt considering that comments.txt is located in the data directory within the same directory where index.php is, is it a correct path?

Re: Improve CuteNews Performance by Adding Page Caching

Cheers for the hack. Noticeable difference.

One thing however... when I go to the 'admin' page of Cute News, I have the following errors at the top of the page.

Warning: filemtime() [function.filemtime]: stat failed for ./cutenews/data/comments.txt in /home/paramore/public_html/cutenews/index.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /home/paramore/public_html/cutenews/index.php:7) in /home/paramore/public_html/cutenews/index.php on line 14

I presume it's something small I must of did wrong when applying the hack.

Re: Improve CuteNews Performance by Adding Page Caching

like Newuser pointed out on line 7 you must change the path to comments.txt
the 2nd warning might be related to the first.

Re: Improve CuteNews Performance by Adding Page Caching

like Newuser pointed out on line 7 you must change the path to comments.txt
the 2nd warning might be related to the first.


Can you please reply to my last post?

Re: Improve CuteNews Performance by Adding Page Caching

Can you please reply to my last post?

i thought i had answered both of you with my previous post http://cutephp.com/forum/style_emoticons/default/smile.gif
changing that path would seem ok i think, altough i think that you could use this page caching also on the pages where you have CN include codes; And then you do need ./cutenews/data/comments.txt

Re: Improve CuteNews Performance by Adding Page Caching

i thought i had answered both of you with my previous post http://cutephp.com/forum/style_emoticons/default/smile.gif
changing that path would seem ok i think, altough i think that you could use this page caching also on the pages where you have CN include codes; And then you do need ./cutenews/data/comments.txt


Thanks. http://cutephp.com/forum/style_emoticons/default/smile.gif
How do i use that caching on the pages with CN include codes?

41 (edited by 2010-04-26 02:03:24)

Re: Improve CuteNews Performance by Adding Page Caching

I am gonna try it too! http://cutephp.com/forum/style_emoticons/default/biggrin.gif

Re: Improve CuteNews Performance by Adding Page Caching

I believe this bug was fixed in IE7, I am not sure it is present in IE6, which most users use now...


Yes IE7 do not have this bug. Cheers

Re: Improve CuteNews Performance by Adding Page Caching

Thanks for these coding. This is a great help for all.

Re: Improve CuteNews Performance by Adding Page Caching

Thanks
I am using this method now..

Re: Improve CuteNews Performance by Adding Page Caching

sorry can somebody tell me how to use this codes? http://cutephp.com/forum/style_emoticons/default/mellow.gif http://cutephp.com/forum/style_emoticons/default/tongue.gif http://cutephp.com/forum/style_emoticons/default/ohmy.gif

Re: Improve CuteNews Performance by Adding Page Caching

Means only cache get the page download more faster .. but if the first time user from the organic search engine it still have to download all the page. so the site speed still slow, is the CSS in CuteNews.. Sorry for my humble question.

Thank very much you in advance ...

Re: Improve CuteNews Performance by Adding Page Caching

Someone told me you will find there's bug using IE cache and it is advisable to add "must-revalidate" inside cache command header or perhaps IE is not going to refresh the particular page just like Netscape/Firefox may.

Re: Improve CuteNews Performance by Adding Page Caching

Its depend your page content quality. and promotional activity..

Packers and Movers in Gurgaon @ http://topservice4u.in/packers-and-movers-gurgaon/
Packers and Movers in Bangalore @ http://topservice4u.in/packers-and-movers-bangalore/

Posts: 26 to 49 of 49

Pages Previous 1 2

You must login or register to post a reply

CutePHP Forums → Script Feedback and Suggestion → Improve CuteNews Performance by Adding Page Caching