Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

how to flush selector based caching

Avatar

Avatar
Validate 1
Level 1
vamshim15803391
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
vamshim15803391
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
vamshim15803391
Level 1

09-05-2020

I need help on how to flush selector based caching

http://example.com/content/myapp/us/en.child1.xml
http://example.com/content/myapp/us/en.child2.xml

Lets say,we have xml's cached under the folder as
/<docroot-cache>/content/myapp/us/
->en.child1.xml
->en.child2.xml
->en.child99.xml
->en.child100.xml
->en.html
->en.model.json

I need to provide selector based caching, that is to flush en.child1.xml only and should not flush en.child2.xml or other xml's when the request for flush happens for /content/myapp/us/en.child1.xml
I've tried dispatcher flush invalidation through HTTP call like below-
GET http://mydispatcher/dispatcher/invalidate.cache
Headers
CQ-Action Activate
CQ-Handle /content/myapp/us/en.child1.xml
Content-Type Application/xml

But,all files under "us" folder(i.e. all selector for en page) gets invalidated, how to just invalidate "en.child1.xml" please suggest

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

449 likes

Total Posts

1,024 posts

Correct Reply

116 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

449 likes

Total Posts

1,024 posts

Correct Reply

116 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

11-05-2020

@vamshim15803391 got this working. Instead of Activate , you need to use DELETE as action. PFB the screenshots

 

Before

Veena_07_0-1589212063897.png

 

Flush

Veena_07_1-1589212089982.png

 

After

Veena_07_2-1589212117819.png

 

Action should be CQ-Action: Delete   instead of Activate

 

Hope this works

Thanks

Veena

 

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

105 likes

Total Posts

118 posts

Correct Reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

105 likes

Total Posts

118 posts

Correct Reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Albin_Issac
MVP

09-05-2020

You should be able to use the ResourceOnly cache invalidation for this scenario - Refer the following video for more details https://youtu.be/teSn_Tqnizo

 

Avatar

Avatar
Give Back 5
Employee
Andrew_Khoury
Employee

Likes

75 likes

Total Posts

93 posts

Correct Reply

33 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
Andrew_Khoury
Employee

Likes

75 likes

Total Posts

93 posts

Correct Reply

33 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
Andrew_Khoury
Employee

11-05-2020

Avatar

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile

Avatar
Validate 1
MVP
Nirmal_Jose
MVP

Likes

118 likes

Total Posts

207 posts

Correct Reply

58 solutions
Top badges earned
Validate 1
Establish
Coach
Contributor
Shape 1
View profile
Nirmal_Jose
MVP

09-05-2020

Dispatcher creates .stat files in each folder from the docroot folder down to the level that you specify. The docroot folder is level 0. When an invalidation request comes in, it will clear that resource and its parent folder to which statfileslevel is set to.

 

What is your /statfileslevel property in dispatcher config set to ?

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

09-05-2020

Hi,

Not sure if you can do that using below command because if

 

The HTTP request has the following form:
 
POST /dispatcher/invalidate.cache HTTP/1.1  
CQ-Action: Activate  
CQ-Handle: path-pattern
Content-Length: 0

Dispatcher flushes (deletes) the cached files and folders that have names that match the value of the CQ-Handler header. For example, a CQ-Handle of /content/geomtrixx-outdoors/en matches the following items:
  • All files (of any file extension) named en in the geometrixx-outdoors directory
  • Any directory named " _jcr_content " below the en directory (which, if it exists, contains cached renderings of sub-nodes of the page)

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

449 likes

Total Posts

1,024 posts

Correct Reply

116 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

449 likes

Total Posts

1,024 posts

Correct Reply

116 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

09-05-2020

Hi @vamshim15803391 

 

   I tried flushing the cache for the below scenario and was able to do it . Please check the screenshots

 

Before Flushing

Veena_07_0-1589023664271.png

Flush

Veena_07_1-1589023709579.png

 

After Flush

Veena_07_2-1589023730457.png

    Ideally , the files should get flushed if the invalidate headers are proper. Could you please cross check ?

 

Thanks

Veena