[SOLVED] Cache Issue

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
User avatar
jaslorax
Forum Members
Forum Members
Posts: 25
Joined: Thu Jan 14, 2010 12:34 am

[SOLVED] Cache Issue

Post by jaslorax »

This may or may not be the correct place for this question as it starts with a question about the core product but may ultimately not be an issue with it . . .

Firstly, I have reviewed http://docs.cmsmadesimple.org/general-i ... g-in-cmsms and not found out what each cache directory is specifically for and this would be very helpful to know.


The "/tmp/cache" appears to be smarty CSS caching and the '/tmp/templates_c" directory appears to be smarty page template caching. This jives with my experience of other products that use Smarty as they had similar folder structures/names. Correct me if I'm wrong about these directories, but more importantly what is being cached in the main cache directory ("/cache") and how is it controlled?

My issue: I am generating up to 8,000 files a day in the "/cache" directory and about 1200MB in 24 hours.

I think this has to do with a couple UDTs I created that call for Google Calendar info. I modified the RSS call with a random string on the end so that each new call looks unique to Google and gets the freshest info; otherwise, it won't get updated for approx. 4 hours and Google offers no workarounds . . . I have not only added 'nocache' to the UDT call, but also wrapped the HTML and the UDT in a "{nocache}" call and turned off UDT caching in the Global Settings. Smarty Caching is off as well. Module calls are set to be cached . . .

Any help or guidance would be much appreciated. Thanks.
Last edited by jaslorax on Fri Dec 13, 2013 11:28 pm, edited 2 times in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Cache Issue

Post by calguy1000 »

the templates_c directory is indeed the smarty template compilation directory.

the cache directory is used for all things cached in files.
- Smarty's compiled HTML Pages
- Various core cached data
- Cached data from modules, and various UDT's.

It's controlled by a setting in the global settings that indicates the maxium age (in days) of files in the cache directory. There is no further control.

Your UDT may be filling up the cache directory because it is downloading a new RSS file to a new name on every request to your web page. This is bad behavior.

You should write your UDT in such a way that
a: it cleans up YOUR files after a certain period of time. Don't touch any body else's files.
b: it caches the data from google for a reasonable period of time (4 hours may be too long, but certainly 30 minutes should not be).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
jaslorax
Forum Members
Forum Members
Posts: 25
Joined: Thu Jan 14, 2010 12:34 am

Re: Cache Issue

Post by jaslorax »

You are indeed correct on where the error was - I just figured out that Magpie RSS was caching every new call; once I deleted the 50+ GBs of files I was able to compare the newly generated files and determine this . . .

My issue is that it does need to be up-to-the-minute as what I am fetching is a number of remaining shows and upcoming shows pulled from Google Calendar which needs to be fresh at the end of every show (up to two per day) and had always been stale data for up to four hours . . .

Thanks for the quick reply. I'll consider this solved as it is related to Magpie RSS caching and will troubleshoot that on my own. Thanks again calguy - on the mark as always.
Post Reply

Return to “CMSMS Core”