JosephSilber / page-cache

Caches responses as static files on disk for lightning fast page loads.
MIT License
1.21k stars 118 forks source link

Handling different top level domains #85

Closed lamalamaMark closed 3 years ago

lamalamaMark commented 3 years ago

Our application is served via 4 different domains with different locales. For as far as we can see it's not possible to handle this situation. Nonetheless I wanted to check if you have handled this situation before? If not we will make a fork / PR for this feature :)

JosephSilber commented 3 years ago

You can easily accomplish this by extending the Cache class, and overwriting the getDirectoryAndFileNames method to prepend the domain name.

You will also have to properly configure your nginx script to account for that.

MarcosBL commented 3 years ago

You can also do it setting a different path depending on locale at boot on AppServiceProvider

Look here https://github.com/JosephSilber/page-cache/issues/74#issuecomment-883701867