Hot answers tagged

5

Like Bhashkar said, that code should work in either a PHP-enabled template or put in a plugin and then put in a template. Then call the template to clear cache. A more advanced way, and probably the proper way to do it, is to create a simple module, which can use an Action URL. Stephen Lewis wrote a blog post about what Actions are. Basically, an action ...


5

Files are written to the static cache directory by Stash - you don't put files in there. Typically these cached files would be your fully rendered HTML pages. This is the opposite of the stash template directory, where you add template files (containing EE tags, variables etc.) which are read by Stash. After creating a folder called 'static_cache' (or ...


4

The session cache only lasts for a single page request. So by the time your action gets called, that cache is gone. You'd be better off adding those to the form as hidden fields, and then grabbing them from POST in your action.


4

I have run into this issue before and I was in the same boat. And "Static Page Caching" didn't do it for me, CE Cache did. I learned that I had to make sure I was really caching the site correctly, such as the right areas and embeds. Also I made sure that I wrote my markup in the best way I could to reduce queries. I hope this helps, I have always found ...


4

{exp:stash:static} caches the entire page to a static file. The cached output is not stored in the database. And you can't cache just a region / section of the page. When it works for you to use {exp:stash:static}, it should return pages noticeably faster than {exp:stash:cache}, and also (since the page requests route directly to the static file, without ...


4

ref: https://docs.expressionengine.com/latest/development/legacy/libraries/cache.html#class-methods ee()->cache->delete('/myaddon/');


3

/system/codeigniter/system/libraries/Cache/Cache.php Has the Cache class - Check this file is on the staging server, also check the permissions. I've often had similar issues where it's related to case sensitivity and differing servers (my local not being case sensitive, the public servers are) - so also check that the folder and file are in the correct ...


3

If you use that code in an EE template (rather than a Stash embed) then EE will parse {segment_1} early, before tags are run and before Stash can escape it. See step 1 here: http://loweblog.com/downloads/ee-parse-order.pdf The good news is you can access any global variable or snippet as a tag like this: {exp:stash:get name="segment_1" type="snippet"} ...


3

Given that the Stash set is inside a loop, the resulting output would repeat your code above multiple times. Thus you would have multiple instance of {exp:stash:not_empty name='br_bulk'} and {exp:stash:br_bulk} in your template. The first instance of each of these will be parsed by EE, but subsequent instances will be replaced with a marker that will later ...


3

Sorry for the trouble. This is an issue in EE 2.9 and will be fixed in the next release. For now, you can get around it by specifying the cache driver in your config.php: $config['cache_driver'] = 'memcached';


3

After speaking with Derek privately I was able to resolve the issue which is a permissions error. The steps taken to solve this are: Via FTP/SSH navigate to system/expressionengine/cache and delete everything with the exception of .htaccess and index.html . Afterwards, change your permissions on system/expressionengine/cache to be 777 then restart your ...


2

I think I would use the cache vs. the user data. The userdata is tied to the specific member that is logged in. The session cache is more appropriately used for add-ons (or developers) wanting to retrieve information in a subsequent method call. $this->EE->session->set_cache('your_addon', 'your_cache_var', 'some value'); $cache = $this->EE->...


2

I'm afraid I cannot reproduce this problem. Logged in/out, cookies enabled or disabled, I find that the cached items are generated only once until they expire. Tested with both EE 2.6.1 and EE 2.7.2 and Stash 2.4.6. To rule out a server vs php timezone configuration issue (where the expiry date may fall in the the past of the server) please try with refresh=...


2

If your code above is in a Stash file (i.e., not a regular EE template), double-check to make sure that you have this Stash config set: $config['stash_file_sync'] = TRUE; I've had this happen to me a few times: I make a change in a Stash file, forget that I have that setting set to FALSE, and wonder why my code isn't working as expected.


2

For me it was my .gitignore file was set to ignore all 'cache/' folders which must be case sensitive. Changing to explicit paths fixed the issue once I redeployed.


2

CE Cache and ExpressionEngine's cache="yes" are not true caches. I hate that they advertise themselves as "caches" - they are not! They simply cache ExpressionEngine template parsing's output at a very high level, the entire PHP stack and ExpressionEngine core still needs to run. Not to mention database traffic, even for non-logged in members due to EE's ...


2

It might be a parse order issue. If so, using Stash should work to save the categories into a variable list, and then you can run the ce_cache:clear when outputting the list (this is untested): {!-- cache a list of the category url titles --} {exp:stash:set_list name="cached_cat_url_title" parse_tags="yes" trim="yes" } {categories} ...


2

{exp:stash:cache} creates a cached variable with the URI as the context. That means each URI at which the host template is viewed will generate a unique instance of the variable. This tag is therefore generally used for full page caching, or for URI-specific fragments of template code. You should use {exp:stash:set} with the site scope to create a single ...


2

the processing time is the "0.9711s" on this image. But you can add this values to your template, if you want to. The {elapsed_time}, the {total_queries}, etc are all available as standard global variables. For example, I usually add something like this to the footer of every page: {if logged_in_group_id == 1 OR site_url == "http://dev.domain.com"} &...


2

EE Control Panel is never being cached by ExpressionEngine itself. The chances are: It is cached server-side by third-party server tools (you might want to talk to your hoster about that) It is cached by your ISP, if you use proxy server It is your browser's cache As one possible way around, try changing Control Panel Session Type in preferences to ...


2

Static caching A static cached page is just plain old HTML, it doesn't pass through EE or PHP at all. You cannot therefore escape regions of the page from caching: https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Astatic%7D Freeform forms cannot be cached as they require a token to be generated for each user that views the form, and that is only ...


2

You can set the template refresh to a really high number (e.g. 14400 minutes which is 10 days), or you can change to using a static cache - for example the one that is built in to the stash add-on. The possible advantage of keeping the EE4 cache with very high numbers is that it works, that it is easy to implement, and that you get (fairly crude) cache-...


2

You could allow the authors member group access to System utilities, you can restrict it so they only have access to "Data operations" which has the clear cache facility. Also add a custom menu link directly to that page for quick access. If you wanted to do it manually delete all the content inside /system/use/cache/default_site


1

Have a look at the caching options available with stash. See Mustash for cache breaking rules. The most basic option here would be to cache the lists when creating them with append list. You might also consider using set_list tags instead of append_list where possible as they will be more efficient (that's my understanding at least)


1

I think it's to do with the {DATE_ATOM} variable including the seconds which I think gets updated when editing an entry thereby triggering it to be displayed again. If you use {gmt_date format="%Y-%m-%dT%H:%i%Q"} (which I use in my RSS templates) or possibly {entry_date format="%Y-%m-%dT%H:%i%Q"} if gmt_date isn't available for ATOM instead I think you ...


1

So the config file for this site had: $db['expressionengine']['swap_pre'] = "pfra_"; when it should in fact have been $db['expressionengine']['swap_pre'] = "exp_"; even although the db tables are all set with a prefix of pfra_


1

I figured it out eventually. I am using a config bootstrap which I set up when I was first learning ExpressionEngine and haven't looked at it much since, apart from updating db settings etc. I had: $config['enable_db_caching'] = "y"; and EE was caching the stash chunks before stash could which was causing all the trouble when I was logged in. I've turned ...


1

That's my understanding too. But rather than me trying to explain why, I think you'd be best contacting Nexcess to ask them to send you a copy of their ExpressionEngine – Caching, and Best Practices for Performance PDF they released after their presentation at the recent EECI Conference as it goes into great detail about the different caching methods ...


1

Currently Freeform does not natively support being cached as it generates a params_id and XID hash on page load that is not reusable due to security concerns. You could, in theory, cache the form, then on submit (or first field change?), use ajax to fetch an uncached version of the same form template and pull the params_id and XID from that uncached form ...


1

Sorry to hear you are having an issue. I cant think of an answer other than step 7 verify permissions. However, once you solve it, Id recommend using master config to set up your environments. It does makes things much easier!


Only top voted, non community-wiki answers of a minimum length are eligible