CuteNews

Welcome Guest ( Log In | Register )

2 Pages V  < 1 2  
Reply to this topicStart new topic
> Improve CuteNews Performance by Adding Page Caching, Be nice to your server by making it work less
FUNimations
post Aug 25 2007, 07:39 PM
Post #26


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



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

CODE
<?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.)


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
dmetro
post Aug 25 2007, 08:36 PM
Post #27


Member
**

Group: Members
Posts: 73
Joined: 18-August 07
Member No.: 21,660



i see... That makes sense to me.


Thanks
Go to the top of the page
 
+Quote Post
Jaybuz
post Nov 7 2007, 06:28 PM
Post #28


Member
**

Group: Members
Posts: 92
Joined: 19-August 07
From: UK, England
Member No.: 21,678



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. smile.gif
Go to the top of the page
 
+Quote Post
Shellz
post Jan 9 2008, 11:09 PM
Post #29


Newbie
*

Group: Members
Posts: 8
Joined: 4-February 07
Member No.: 17,669



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?

This post has been edited by Shellz: Jan 9 2008, 11:10 PM


--------------------
My Corner of the Web:
Bubbly-Chica.Info
Go to the top of the page
 
+Quote Post
FUNimations
post May 6 2008, 02:25 PM
Post #30


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



No hack is official, that's why it's called a hack smile.gif

To answer your question: don't know.


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
Newsuser
post Oct 20 2008, 10:59 PM
Post #31


Newbie
*

Group: Members
Posts: 40
Joined: 29-December 06
Member No.: 16,884



Hi,

The final code is the one from post #7?

This post has been edited by Newsuser: Nov 7 2008, 09:56 PM
Go to the top of the page
 
+Quote Post
FUNimations
post Oct 21 2008, 04:46 PM
Post #32


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



yep


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
Newsuser
post Nov 7 2008, 11:44 PM
Post #33


Newbie
*

Group: Members
Posts: 40
Joined: 29-December 06
Member No.: 16,884



QUOTE (FUNimations @ Oct 21 2008, 08:46 PM) *
yep

Ok, so i have to simply add the code from post #7 before
CODE
<?PHP

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

to my script's main index.php file(the one which opens admin login page)?
Go to the top of the page
 
+Quote Post
FUNimations
post Nov 8 2008, 10:04 AM
Post #34


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



yes


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
Newsuser
post Nov 11 2008, 11:47 PM
Post #35


Newbie
*

Group: Members
Posts: 40
Joined: 29-December 06
Member No.: 16,884



QUOTE (FUNimations @ Nov 8 2008, 02:04 PM) *
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?
Go to the top of the page
 
+Quote Post
ticky
post Nov 14 2008, 05:56 AM
Post #36


Newbie
*

Group: Members
Posts: 1
Joined: 14-November 08
Member No.: 28,802



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.

CODE
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.
Go to the top of the page
 
+Quote Post
FUNimations
post Nov 14 2008, 01:50 PM
Post #37


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



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


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
Newsuser
post Nov 16 2008, 09:47 PM
Post #38


Newbie
*

Group: Members
Posts: 40
Joined: 29-December 06
Member No.: 16,884



QUOTE (FUNimations @ Nov 14 2008, 05:50 PM) *
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?
Go to the top of the page
 
+Quote Post
FUNimations
post Nov 16 2008, 10:21 PM
Post #39


CuteNews Support Crew Pimp
***

Group: Support
Posts: 16,501
Joined: 28-August 05
From: Belgium
Member No.: 5,662



QUOTE
Can you please reply to my last post?
i thought i had answered both of you with my previous post 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


--------------------

General FAQ
Spam Protection In Cutenews
Comments get deleted
_______________________
<< If you appreciate my help
Go to the top of the page
 
+Quote Post
Newsuser
post Nov 17 2008, 01:22 AM
Post #40


Newbie
*

Group: Members
Posts: 40
Joined: 29-December 06
Member No.: 16,884



QUOTE (FUNimations @ Nov 17 2008, 02:21 AM) *
i thought i had answered both of you with my previous post 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. smile.gif
How do i use that caching on the pages with CN include codes?
Go to the top of the page
 
+Quote Post
hishamsupian
post Feb 9 2013, 09:09 PM
Post #41


Newbie
*

Group: Members
Posts: 3
Joined: 16-January 13
From: Melaka, Malaysia
Member No.: 87,380



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 ...
Go to the top of the page
 
+Quote Post
upfront559
post Feb 13 2013, 08:53 AM
Post #42


Newbie
*

Group: Members
Posts: 4
Joined: 12-January 13
Member No.: 87,103



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.


--------------------
http://upfrontconsultants.com
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Fast ReplyReply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 20th May 2013 - 07:28 PM