Hot answers tagged

4

I don't think there are any add-ons available currently modify the headers for caching. There is, however, HTTP Header, by Rob Sanchez that you could use as a basis to do this. It wouldn't be very difficult to modify HTTP Header to include additional header options, or you could turn on PHP for your templates and place the code directly in the templates, ...


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

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

The answer to this lay in the Varnish configuration. Basically, in the vcl_recv function, I created my logic for whether to "lookup" (check the cache, fetch from the backend if the cache is empty), or "pass" (always serve from the backend). Then in vcl_pass, I added an HTTP header to the request indicating "this request was passed and should never be cached"...


3

For the {exp:stash:get} tag save is only used with dynamic="yes" when retrieving dynamic values from $_POST, $_GET or segment arrays. For your menu it only makes sense to stash the parts of your menu as separate lists if you are re-using those values elsewhere. Otherwise, just wrap the tags that generate the menu with a {exp:stash:set} with the output ...


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 ...


3

So my experimentation here brought me to Stash. Much more succinct now and gives me everything I need in just 66 queries before caching :) {exp:channel:entries dynamic="no" channel="articles"} {categories} {exp:stash:append_list name="news_{category_id}"} {stash:item_title}{title} - {entry_date {gv_date_short}}{/stash:item_title} {/...


3

I personally think the ideal is that each page is cached non-stop until the content or template changes. This is possible with add-ons like Causing Effect CE Cache, which is great for high-performance / high-load sites. On these sites, pages can be cached for days and months without being refreshed. When I use only the built-in EE caching, I tend to set the ...


3

You embed IS being "cached" - saved to the Stash database table as a variable - but it's not being parsed before being cached. That is because, out of the box, a Stash embed works just like an EE embed: the content of the embed file is included into the host template and then parsed at runtime. The parsing stage of an embed is controlled by the ...


3

I finally got this working (Low Search working with Stash static cached homepage)!!! I added the following rule to my .htaccess, to get it to really really ignore POST requests. I'm not sure why this works (maybe it's my server environment? I'm on a Nexcess EE-Optimized plan). So I added the following RewriteCond RewriteCond %{THE_REQUEST} ^(GET) And ...


3

(I've given the following answer in the @devot-ee support forums, but am reposting for anyone who comes across it...) Hi PaleoSun, The random tag parameter isn’t relevant here, because it’s a slightly different issue to the one that is meant to resolve... At least in the short-term, there is no real fix other than to disable caching of any template that ...


3

@Jae - You can use rules in the same way with CE Cache. The parameter tag= allows to you add tags and then in the cp, control when they are refreshed - hope that helps. In terms caching and partials, I use CE to cache the wrapper with the parameter global="yes" and then escape the stash:get. Then within the stash:set cache the page. I also set the caching ...


2

Everyone has their own method for using Stash and the various caching tools. I find that Stash is great for simplifying my structure (more DRY) which also has a side effect of dropping overhead. But my first goal with Stash is "stashing" a block of functionality so that I can move it elsewhere within my "waterfall" of template rendering and / or cloning ...


2

It sounds like some of those templates have cache enabled? Did you check the template preferences? Go to Templates > Choose Template Group > Click Preferences > Here you can adjust template settings


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

I think I've found the issue and solution. It seems sometimes mod_dir will be setup to do it's thing before mod_rewrite. This means that %{REQUEST_URI} for the homepage could end up being index.php instead of /. To account for this, I updated the the htaccess rule: #------------------- CE Cache Static Driver ------------------- RewriteCond %{REQUEST_URI} !...


2

Since my guess in the comments was correct I am adding it as an answer: Check that mod_expires is installed in Apache (one way to quickly check in EE is to look at the phpinfo page in the control panel).


1

We never recommend caching a form because it has a unique identifier from ExpressionEngine for CSRF protection that's generated per page as well as a unique identifier from Freeform used to prevent spamming, malicious form manipulation, and to assist in multipage forms. You are getting the invalid form ID error because the cached form isn't able to ...


1

Interesting approach. I would typically have used Stash to set a list of all my entries (capturing categories for each of them) set a list of all the categories I want And then used nested {exp:stash:get_list} with match_against to get entries ordered by categories. Same principle as this gist by Mark Croxton Don't know if that would lower your number of ...


1

After some research and digging into the actual Cache_redis.php file, I've found that there is currently not a way to specify a DB index without modifying the ExpressionEngine Core. The only way to handle multiple dev/staging servers would be to utilize a something like the Focus Labs Master Config and configure separate Redis servers for each install.


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

Are you using a multi config environment? If you are, depending on how it's set up it may be looking for www. I ran into this problem, (couldn't log in) but adding this to the .htaccess fixed it. RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


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

It's been long enough now that I don't remember the details, but I had a conversation with Nevin of Engine Hosting and his recommendation was 10 minutes max. Maybe a conversation with someone from your hosting environment is in order.


1

Your htaccess looks OK to me--I think it should be doing what you want. But you could try changing the Request Method match from this: RewriteCond %{REQUEST_METHOD} GET to this more strict match: RewriteCond %{REQUEST_METHOD} ^GET$ Another rewrite technique I've used, that I know works, is to enclose the rules in a Limit block, like: <Limit GET> ...


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

Doesn't the {categories} tag pair work with search results? You can restrict the categories by group, or exclude some categories if you don't want them to show up. I use gwcode in some situations, but most of the time this tag pair takes care of things. Check the docs here: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries....


1

Figured this out. For some reason the combined .css and .js files are updated once you update changes to a template.


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