All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Clearing tags with {url_title} in the console

Status Resolved
Add-on / Version Speedy 1.8.1
Severity
EE Version 7.3.12

Harold Kuiper

Nov 01, 2023

Hi Brian,

Question:
On my homepage we have thumbnails of the entries within the site.

I rather tag them by their url_title as the cache breaking rules would empty that fragment on the homepage only when one of the entries with that url_title tag is in it. Instead of having a general tag (like entries_thumbs) as that would clear the cache even if one of the other entries aren’t in it.

In the console I can’t add tags based on the url title in the cache breaking settings or is it?
What do you suggest in the situation I use the speedy:add_tag and use the url and as soon as an entry is being resaved it refreshes also the fragment on the homepage?

Harold

 

#1

BoldMinded (Brian)

Hi, Harold. Can you please share some screenshots of your cache breaking tags and anything else that is relevant?

#2

Harold Kuiper

Comment has been marked private.

#3

BoldMinded (Brian)

Not really. What do your Speedy settings pages look like for the cache busting? What do you mean by console? What commands are you issuing in the console? Can you record a video of the entire process?

#4

Harold Kuiper

Hi Brian, I’ve added some screenshots.

I’ll try to explain it a little more clearly.

Front-end button with clear I have the option to delete a cached item in the frontend through a button. What I do is delete the item and the tag through exp:speedy:clear. I tag every entry with date-channel-url_title. That gives me the option to clear elements that contain that entry. That is a dynamic solution because there are compositions of entries here and there in the site and in this way I only clear the cache if those specific entries appears in it.

Resaving an entry But… there are also the Cache Clearing Rules in the CMS. So if an entry in the CMS is edited, you also want everything where that entry appears to be cleared. But in those field you can’t add dynamic elements (like {entry_date format=’%y%m%d’}-{channel_short_name}-{url_title}). So it works through a exp:speedy:clear request but not via the Cache Clearing Rules when having edited an entry.

Hope I made the issue clearer.

Best regards,

Harold

#5

BoldMinded (Brian)

Have you tried creating the cache tags without the date parameter? I’m actually surprised it accepts entry_date format as an option. Dates are dynamic and changing, so I can see how the cache clearing rules won’t work correctly by using a value like that.

#6

Harold Kuiper

  1. I’ve changed the tags into {channel}-{url_title}. And I’ve added it to the Cache Clearing Rules.
  2. When resaving an entry it removes everything with the hardcoded tags (in my case articles-home for example) and the item itself in local.
  3. But not the elements tagged with {channel}-{url_title}. When doing the same but with exp:speedy:clear and then referring to the item and the tags (see screenshots) it works (also the cached elements with the tags {channel}-{url_title} are being cleared. Best regards, Harold
#7

BoldMinded (Brian)

What cache driver are you using? File, Database, Redis?

#8

BoldMinded (Brian)

What is {snp_cache_tags}? What does it contain??

#9

BoldMinded (Brian)

Comment has been marked private.

#10

BoldMinded (Brian)

Comment has been marked private.

#11

Harold Kuiper

I use a snippet to be sure all tags are of the same structure so ce_cache_tags is: {channel}-{url_title} in this case. I had the date in it as well but removed on your advice. Will try your build now.

#12

Harold Kuiper

O… using Redis by the way.

#13

Harold Kuiper

Hi Brian, It works! The point where I got confused, is that where I use {channel}-{url_title} to define my tags. The cache clearing rule has to be {channel_name}-{url_title}. But now, when clearing the cache through exp:speedy:clear does the same as when I save an entry. And that makes everything easier as now I can define everything through tags and only clear the elements where the entry appears in an overview. Thanks. Best regards, Harold

#14

Harold Kuiper

Hi Brian, An extra question: 1. with the above method, the list of tags grows super fast. Should I write something to empty that list like once a week? 2. elements on the home contain the latest entries. Every time an entry is added the element is being cleared. The tags tied to it are being cleared as well is it? So the elements only contain the tags that are visible right? Best regards, Harold

#15

Harold Kuiper

Hi Brian, I might make a thinking error: When adding an entry it should appear on the homepage (in our case). That means the container that will contain the entry should be cleared. That means also I need to add an ‘entry-container-home’ tag to that element which also means I can’t work with the {channel_name}-{url_title} tag as that one only clears when an entry is being edited. That means every addition of entries will clear the container elements on the homepage right? And that means I can remove the whole tags-approach is it? Can you confirm my thoughts? Best regards, Harold

#16

BoldMinded (Brian)

I can’t say for certain, you’re asking a theoretical question about a site I have very little knowledge of. If I understand correctly you can skip tags and just clear it by URL instead any time an entry in a channel that appears on the home page is saved.

Login to reply