<![CDATA[ Snippet Cache - $_GET[URL] - My Forums]]> https://forums.modx.com/thread/?thread=104862 <![CDATA[Snippet Cache - $_GET[URL]]]> https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563839
I am redirecting a few different admin tools back to a modx site/page for unauthorized access.
The redirect has the modx page id and a URL variable in the URL.

On the modx page it has the an "Unauthorized Access" and then has a PHP snippet.
the snippet says "Requested URL: [URL]".

It works fine, but its caching the URL.... so if you go to the other system and get redirected back to the modx main site then the URL could be wrong.

Is there a way to turn off the cache? is there a better way of doing this ?


here is my php snippet code:

<?php
$site_text = "";

$site_text .= "Requested URL:   ";
$site_text .= "$_GET[URL]";
    
$site_text .= "<BR><BR><BR>You have been redirected to domain.com";

return $site_text;

]]>
mferry Jan 30, 2019, 03:23 PM https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563839
<![CDATA[Re: Snippet Cache - $_GET[URL]]]> https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563880
When a snippet is called without the !, MODX caches the snippet's return value and serves it up every time the snippet is called until the MODX cache is cleared. That goes for all other MODX tags as well, so you only want to call things uncached (without the !) when what they return won't change often or the changes will be made in the Manager, which clears the cache when you save things.]]>
BobRay Jan 31, 2019, 10:48 PM https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563880
<![CDATA[Re: Snippet Cache - $_GET[URL]]]> https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563848
Thanks....]]>
mferry Jan 31, 2019, 12:12 AM https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563848
<![CDATA[Re: Snippet Cache - $_GET[URL]]]> https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563847
I'm using [[Unauthorized-Site-URL]]]]>
mferry Jan 31, 2019, 12:06 AM https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563847
<![CDATA[Re: Snippet Cache - $_GET[URL] (Best Answer)]]> https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563843
[[!SnippetName]]
]]>
BobRay Jan 30, 2019, 08:10 PM https://forums.modx.com/thread/104862/snippet-cache---get-url#dis-post-563843