symphonists / cachelite

Dead simple caching extension for the Symphony CMS. Uses the CacheLite library.
Other
19 stars 11 forks source link

Conflict between Cachelite and URL Router #8

Closed vlad-ghita closed 10 years ago

vlad-ghita commented 12 years ago

There's a conflict between Cachelite and URL Router.

On line 19 in extension.driver.php you're caching the GET array.

On line 441 you're using the symphony-page variable from the cached GET array to determine if the page should be excluded or not from cache. However, in case of a setup using the URL Router extension, most probably this variable will not match the actual page path because of re-routing, thus resulting a false negative.

I suggest Cachelite should subscribe to FrontendPrePageResolve delegate and after URL Router fired it's callback, Cachelite should use the page path generated by URL Router for further processing.

designermonkey commented 12 years ago

@vlad-ghita that's a good spot there, can you confirm this?

vlad-ghita commented 12 years ago

I stumbled on it already. Yes, I can confirm this.

designermonkey commented 12 years ago

If anyone knows how to achieve this, can you pick it up please?

vlad-ghita commented 12 years ago

Quick fix:

Uninstall Cachelite. Install Cachelite.

Hopefully, it will get the highest ID in tbl_extensions table and thus fire latest (after URL Router).

Though I think Sym 2.3 executes extension delegates alphabetically in Extenion order ... sucks :(

Ideal option ... custom delegate execution order editable in Admin ;;)

designermonkey commented 12 years ago

Maybe @brendo can shed some light on how we could do this?

nickdunn commented 12 years ago

Agreed, CacheLite should be updated so that it waits for the page to be properly resolved first.

designermonkey commented 12 years ago

Would anyone like to take charge of this?

jensscherbl commented 12 years ago

Depends on how fast you need it. I would do it, but could take a few days before I actually get to do it.

designermonkey commented 12 years ago

There's no urgency, just a need to take ownership of the update.

Really appreciate it Jens.

brendo commented 12 years ago

While there is no way to currently make Cachelite execute before URL Router (see #993), I think this issue can be solved by using the information that is passed via the delegate instead of using the $_GET array.

The FrontendPageResolved delegate passes back the page_data of the resolved page, which contains the current page path which looks like it may simplify the logic of that _in_excluded_pages() function.

jensscherbl commented 12 years ago

@brendo Thanks. Will try that.

vlad-ghita commented 12 years ago

@jensscherbl

Any updates on this?

jensscherbl commented 12 years ago

Will push an update next week, sorry for the delay.