brendanheywood / moodle-local_cleanurls

Lets drag Moodle's url structure into this century...
37 stars 24 forks source link

Caching cleaned URLs not working after url changes #102

Open roperto opened 7 years ago

roperto commented 7 years ago

If you move a course module to another section, it hold the cache for the old URL.

We may have other similar problems.

Should we watch for that event and remove that URL from the cache (what other scenarios should we think about too?)

I think it would also be nice to have a way to disable Clean URL caching (dev or debugging mode) or even a quick-link to clean it.

Brendan's spec ideas:

ie if a course shortcode changes then

when a pageview for COMP100 hits the router and gets to the course uncleaner if will

brendanheywood commented 7 years ago

There are a few moving parts to this:

roperto commented 7 years ago

I didnt quite understand the 4 caches idea, we can discuss that later.

Cheers,

Daniel

roperto commented 7 years ago

After changing a custom activity path as in PR #105 the outgoing cache old entry is removed so the new one can be generated, but ont the reverse uncleaning so the previous URL can still be used.

I think using the cache to implement instead of the DB is very flawed, IMHO cache should only be used to improve performance, clearing caches should not affect the behaviour of the uncleaner like it does now (after cleaning caches the old urls become invalid).

This is not major, but something to think about.

brendanheywood commented 7 years ago

Yup totally agree this should be persisted in db, and then cached on top. For public urls that have been crawled by google as an example we will need to persist these for say a month until google can re-scrape in order to re-canonicalize these urls. And for long history permalinks we need to keep them essentially forever.

roperto commented 7 years ago

@brendanheywood Please note I made a change in the way course URLs are uncleaned, see commit message: https://github.com/brendanheywood/moodle-local_cleanurls/commit/ef44e16210cd7c3b762280b0127092e8cf2f7259

brendanheywood commented 7 years ago

+1