Active
Project:
Cache Expiration
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2013 at 20:52 UTC
Updated:
10 Oct 2017 at 02:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kobee commented+1
How the wildcard works?
I've tried many combination, but no success..
Also how to add all the paginated pages like this:
headlines?page=1
headlines?page=2
headlines?page=3, etc...
Thanks.
Comment #2
spleshka@Vacilando,
About using wildcards - please, pay your attencion at the function https://api.drupal.org/api/drupal/includes!cache.inc/function/cache_clea.... The third param is a wildcard.
1. Wildcard can be used only at the end of a cache id. Example: node* or node/list?page=*.
2. Yes, they should works as well.
3. Currently if aliases are enabled that means that only aliased pages will be flushes. This coded like that because with aliases always used globalredirect or redirect module that provides 301 redirect to the page with alias. If you want other behavior here you may create a feature request, or just code a few lines of code yourself.
4. As I answered above, only at the end.
@kobee,
See the information above.
Comment #3
kobee commentedThanks for your answer, but it doesn't seems to work..
1/ I've tried:
But only the "headlines" and "schedule" are flushed.
Not "schedule/2013-08-25" neither "headlines?page=1" etc....
Is it a bug in the "Cache Expiration" module?
2/ Also if the wildcard is "*" , why the help says "Example: node/[node:nid]|wildcard" and not "Example: node/*" like everywhere in Drupal (in Boost page, or Display block rule for example..)?
3/ I'm on Nginx with perusio config, but WHY we need to flush the pages instead of using the expires headers like in Apache?
4/ I tried a cron command rm -rf /cache/normal/* but it just crash as their is too much pages.
Comment #4
spleshka@kobee,
1. Yeah, you should use |wildcard instead of * in the UI. Sorry for the wrong example. I mean that this should work:
Use debug output to get info about flushed pages.
2. See above
3. I suppose that you are using Boost. In your case it is possible to show expire header. But Cache Expiration module provides more common functionality. More over, if file was deleted phisically from the file system, Drupal will be force to generate a new one.
4. Delete them manually.
Comment #5
kobee commented@Spleshka
1/ I used it but still not work.
How can help the debug output?
2/ Why not changing the module, to keep consistency over all the Drupal interface (using *)?
3/ You're right, I'm using Boost. But the Perusio config doesn't work like normal apache rules, and the expires files won't refresh. So I HAVE to use Cache Expiration module to delete physically the files in order to force the refresh.
4/ I've tried also, but doesn't help. It's too big. So I've renamed my cache directory with "mv" command.. But it's not the solution ;-)
Comment #6
vacilando commented@Spleshka, thanks for your clear answers!
I have to admit the help text at admin/structure/types/manage/article fooled me. I guess the reasons were:
In fact what I had used was: my/path/*|wildcard
I suggest to change the textarea help text lines from:
to:
The API URL there would be a link under a text label.
The last line (about tokens) would remain intact.
If you agree and so wish, I can provide it in a patch.
Comment #7
spleshka@kobee,
1. As far as I know, Boost does not provide wildcard flushes.
2. To be honest, I don't remember why I did this. But I'm sure that there were some reasons :)
3. Even Perusio's config relies on cached file existance. So yes, you need to remove files to force drupal to generate them again.
4. Try to do it step-by-step, deleting each folder in a cache directory.
@Vacilano,
Sure, such patch makes sense!
Comment #8
vacilando commentedOK, here's a patch improving each help section that deals with wildcards.
Comment #9
spleshkaThanks! Commited/pushed to 7.x-2.x.
Comment #10.0
(not verified) commentedAdded one more question.
Comment #11
richsky commentedWell as far as I tested "|wildcard", it doesn't work with boost.
Comment #12
spleshkaProbably this is a Boost issue? Wildcards support appeared only in the 7.x-2.x branch.
Comment #13
RAFA3L commentedWith the module Context Mobile Detect doesn't work...
For example Context Mobile Detect generate this cid for cache:
http://localhost/testcache/test?page=1&device=1&device_type=blackberry
This is a cached page of a view and has been seen from my phone.
The desktop cached pages are cleared properly using test|wildcard, for example:
http://localhost/testcache/test
http://localhost/testcache/test?page=1
http://localhost/testcache/test?page=2
...
Same with any content using content|wildcard:
http://localhost/testcache/content/test1
http://localhost/testcache/content/test2
...
Maybe the problem is where the url have multiple arguments and ampersands
Comment #14
RAFA3L commentedIm sorry, the problem was because on desktop I was using http://localhost and in my mobile http://mydomain.noip.com
But the problem continue with the home page, I tried with < front >|wildcard but all the cached pages are cleared, and for example http://mydomain.noip.com/testcache/?device|wildcard doesn't work
I would like clear all the versions and I don't know what token use to make it to work when this have a query string.
Comment #15
beauregard commentedI am trying to use wildcards together with the boost module. As I understand, this does not work together, is this correct? Is this a problem of boost or a problem of the expiration module?
I have a view called "cars". This is a paged view plus the car-nodes are saved in cars/car1, cars/car2 etc.
So I would need a wildcard for the paged view "cards" as well for all pages within cars.
I tried this cars|wildcard, which did not work.
Beside that, would it not be correct to use the wildcard as follows:
cars|wildcard --> for all URLs such as carsmercedes, carsbmw, carsfiat etc
cars/|wildcard --> for all URLS within cards, e.g. cars/car1, cars/car2 etc
Comment #16
beauregard commentedI set status=active, because I added a comment to this task, thinking it belongs here.
If not, let me know and I open a new task
Comment #17
drclaw commentedIndeed, Boost does not currently support wildcards in it's implementation of
hook_expire_cache, however there is some work going on in the boost issue queue to get it there #1810936: Support wildcards in boost_expire_cacheComment #18
beauregard commentedgreat, thanks for the info. I will check it out.
Comment #19
naero commentedSimply put — for wildcards use this:
|wildcardFor example, use:
some/path/to/a/wildcard/path|wildcardInstead of:
some/path/to/a/wildcard/path*Comment #20
garamani commentedWith the latest patch here you can use wildcards in Boost.
You can use asterisk (*) with Rules module for "Clear URL(s) from the page cache." action and also in the Cache Expiration UI.
Note: |wildcard doesn't work with boost module.
Comment #21
beauregard commentedhm, this is not true. I am using boost and |wildcard with this patch since 3 weeks.
Comment #22
RAWDESK commentedHi, i've been using both methods simultaneous now, but in either case i seem to have a conflict with Internationalisation module which creates sub paths for my cached pages.
Eg. example.com/catalog becomes example.com/nl/catalog and example.com/fr/catalog in my Boost cache folder.
Whenever i try to set up an expiration rule, whether it is via Rules or Boost Cache Expiration on specific content type (in my case Product), the setted paths to clear are only partially performed.
More specific, only the pages behind the nl/ paths are cleared.
My Rules 'Clear URL(s) from the page cache' action values :
catalog
nl/catalog
fr/catalog
cataloog/*
nl/cataloog/*
fr/cataloog/*
cataloog/|wildcard
nl/cataloog/|wildcard
fr/cataloog/|wildcard
cache/normal/castabo.be/cataloog/*
cache/normal/castabo.be/fr/cataloog/*
cache/normal/castabo.be/nl/cataloog/*
My Product content type cache expiration entered custom URLs on node insert/update/delete :
shop
catalog
cataloog|wildcard
nl/cataloog|wildcard
fr/cataloog|wildcard
cataloog/|wildcard
nl/cataloog/|wildcard
fr/cataloog/|wildcard
As you can see, i am using the wildcard in several ways but only partial clearing is performed on the nl/ content.
Comment #23
nwom commented@RAWDESK take a look at #2267305: Problem when clearing the cache of nodes using entity translation. That patch may be what you're looking for.
Comment #24
nwom commentedAfter looking at the documentation and testing it on the site, I think I understand the usage of wildcards, but one question still remains. How do I go about adding a wildcard that includes all potential query parameters?
I have a page that has views exposed filters and Facet API searches. There's potentially an unlimited amount of combinations of query parameters that can appear in the URL. So specifying everything after the URL as a wildcard would be extremely beneficial and is something I sadly haven't quite solved yet.
Thanks in advanced for any help.
Comment #25
rahim123 commentedHi there, I'm not sure if it's a coding bug or a documentation problem, but I can't get wildcard expiration to work with Boost for my forum overview pages. I added the following wildcards:
But still, paths like
forum/misc/whateveraren't expiring. If I specifically addforum/misc/whateveras a custom rule it does expire, so it's just a wildcard problem.Comment #26
delacosta456 commented@sb56637 and for some people that has faced this situation like me.. i would like to share what i noticed (after try for many days).This are some directions that may help
Step1-- only
forum|wildcardorblog|wildcardshould be added which mean's you list can looks likeforum|wildcardblog|wildcardnode/1node/5.............
AND NOT containing 2 same "wildcards" intention at the same time like in #25
Step2-- Make sure you enable authcache_builtin_expire_v2 module and that /admin/config/system/expire on "Module status TAB" you choose External expiration and also enable Include base URL in expires
Step3-- NOTE that when you enable authcache_builtin_expire_v2 module , it's has dendency module : Authcache Enumerate (authcache_enum) . As soon as authcache_enum is enabled , if you where working with super user (default admin of drupal) account and at admin/config/system/authcache you enable "Allow caching for superuser (uid = 1)", please check drupal's status page where you will see a notification of CONFLICT asking you to disable/uncheck "Allow caching for superuser (uid = 1)". If you disable it logically this mean that caching will be exclued (IT WAS WHAT I NOTICE)..enable caching for role administrator at admin/config/system/authcache .. then ... (step4)...
Step4-- Create another drupal user, to which you assign the role of Administrator ... login to that new account , clear all your cache (rebuild registry if possible).. AND TEST PAGES NOW
Doing so was what helped me..