How to perform transparent cache layer between backend and client (with SSI)?

33 views
Skip to first unread message

Andriy Kravets

unread,
Feb 12, 2017, 6:36:21 AM2/12/17
to openresty-en
Hello to anyone! My name is Andriy. I'm newbie in Openresty, but its really cool idea and I glad, that we have such powerful thing (thanks to the maintainers).
So, I have an question. Now I'm trying to implement transparent cache layer, based on Openresty LUA and Nginx SSI. I want to reach following:
When client calls an page, Openresty should check, does the requested page exists in cache ( lua_shared_dict ), and if its not -> gets the page through PHP-fpm as source of data and save it, if yes -> retrieves page from cache. Note, that page should contain SSI-includes, that also should  be checked in cache and if do exist -> be returned, if the're not -> should be requested and saved in cache and then retrieved.
I stuck, because I don't know how to split logic :(
Maybe, someone, who has more experience, has an idea how to implement that? Thanks for any advice.
Cheers.
Reply all
Reply to author
Forward
0 new messages