[SOLVED] Have to empty cache after making changes to site

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

[SOLVED] Have to empty cache after making changes to site

Post by Paul J »

Hello all

I've been having a small problem with a CMSms site I've been working on for a while. Every time I edit a template, the CSS or any kind of content, I have to click 'clear cache' to get the changes to take effect.

This has happened under various versions of the CMS as I've been working on the site; the current version installed is 1.7. I don't have this problem on any of my other CMSms sites.

The solution is possibly just something simple (to do with the initial installation? An incorrect setting somewhere?) but it's had me baffled for a few months.

Any help or suggestions gratefully appreciated!

Thanks

Paul
Last edited by Paul J on Thu Apr 01, 2010 8:07 pm, edited 1 time in total.
JeremyBASS

Re: Have to empty cache after making changes to site

Post by JeremyBASS »

Thou you'd have to change and pull script for your needs...

http://forum.cmsmadesimple.org/index.ph ... _next=next  ***edit << it should be noted that this was from google... we need to address this I'd think.. ****

http://forum.cmsmadesimple.org/index.php?topic=27171.30

What you could do is make a UDT with the clear script call and set that udt on the events... like edit and create content...

Hope this helps Cheers -Jeremy
Last edited by JeremyBASS on Tue Mar 30, 2010 9:24 pm, edited 1 time in total.
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Re: Have to empty cache after making changes to site

Post by Paul J »

Thanks for your quick reply, Jeremy. That's a bit more complicated than I was perhaps expecting, so will have to have a good look at it all when I have a little more time.

Thanks again

Paul
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Have to empty cache after making changes to site

Post by Rolf »

Extentions >> User Defined Tags
Create a User Defined Tag called f.i. clear_cache with the content:

Code: Select all

// Cut out of file: admin/siteprefs.php

{
	global $gCms;
	$contentops =& $gCms->GetContentOperations();
	$contentops->ClearCache();
	// $message .= lang('cachecleared');
}
Extentions >> Event Manager
Call the UDT on an event.
In your case probably: ContentEditPost - Sent after edits to content are saved

Hope this helps.

Regards, Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
JeremyBASS

Re: Have to empty cache after making changes to site

Post by JeremyBASS »

yep that is what I was suggesting to pull out of that link.. But it should be noted in the UDT just copy and paste

Code: Select all

	global $gCms;
	$contentops =& $gCms->GetContentOperations();
	$contentops->ClearCache();

I should also be noted that you will see a bump in the time it takes to post.. Just FYI

glad Rolf had the moment to get that, I was so rushed :D Cheers -Jeremy
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Re: Have to empty cache after making changes to site

Post by Paul J »

Rolf: dank je wel!  :)
Jeremy: thanks again!

I have to go out now but will try what you suggest later today and will report back.

Thanks

Paul
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Re: Have to empty cache after making changes to site

Post by Paul J »

It works! Many thanks to both of you!  :)

JeremyBASS wrote:
I should also be noted that you will see a bump in the time it takes to post.. Just FYI
I didn't notice much of a delay, but it doesn't matter too much as I'll be handing this site over to the client soon. This is a much better solution than having him emptying the cache after every edit.

I wonder why the cache needed to be emptied to view changes on this site, when I have two other CMS made simple sites on the same host (different accounts though) where the content is updated straight away?  ???

Anyway, thanks again!  :)
andrewvideo
Forum Members
Forum Members
Posts: 127
Joined: Fri Nov 28, 2008 10:28 pm

Re: [SOLVED] Have to empty cache after making changes to site

Post by andrewvideo »

Is this save to keep that tag in? I can't notice any speed differences when loading pages.

Would be possible to have a tag that it clear the cache once a week?

Andrew
Paul J
Forum Members
Forum Members
Posts: 52
Joined: Tue Feb 02, 2010 6:51 pm

Re: [SOLVED] Have to empty cache after making changes to site

Post by Paul J »

Dr.CSS wrote: I would be interested to see what the permissions on tmp, tmp/cache and tmp/templates_c folders are set to...
They're 755. I've just checked my other sites on the same host, where I didn't have the cache problem, and they're the same. Hope that helps?
spiriralph
Forum Members
Forum Members
Posts: 36
Joined: Sat Jun 27, 2009 10:52 am

Re: [SOLVED] Have to empty cache after making changes to site

Post by spiriralph »

Hi dear Rolf

How we can clear cache (tmp) every time a visitor cames & openning the web site or web page from search systems

best regards!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: [SOLVED] Have to empty cache after making changes to site

Post by Rolf »

spiriralph wrote: How we can clear cache (tmp) every time a visitor cames & openning the web site or web page from search systems
If you call the {clear_cache} tag in the Event Manager in f.e. ContentPostRender (Sent before the combined html is sent to the browser) it should do the trick.

®olf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “CMSMS Core”