The siteCache.idx.php file is over 1.65MB. Is this normal? I overwrote it with one from a default install when first trying to fix the errors so this is just from the past few days.
-
MODX Staff
- 10,725 Posts
Depending on how many Resources and Elements make up your site, that could be a perfectly normal cache file size.
-
☆ A M B ☆
- 24,524 Posts
If you are on a "cloud", it is possible that your files are being scattered across different servers, so the individual page cache files may end up on a different server than the one that fielded the request for the page. This used to be a problem with session files across distributed servers; most such configurations have by now figured out to use a single shared point for their /tmp storage.
That makes sense, refreshing the content of the cache directory shows the files are being deleted about as quickly as they are added. I know the pages are not being updated that quickly and we did not have this problem with the same site on 0.9.6. I’ll peruse my snippets and see if I can find any cache related api calls.
I think I found it, I had a snippet that was changing the parent of older news stories every time a template was accessed and then clearing the cache. I’ll look at a better way of doing this since it is generating more database queries than necessary and negating the effectiveness of the cache. Thank you all for all your insights!
UPDATE:
I am very sure that was it.
I was using $modx->clearCache() after moving the resource which totally wiped out the cache before the page loaded. It only did so when there was a resource to move. Question: is it necessary to clear the cache after changing a parent in the database?