Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
1.4k views
in Q2A Core by
edited by
Is it possible to schedule a cache or static site generation and serve that to not logged in users?
by
+1
Possible? Yes. Worthwhile? Most likely not. What problem are you trying to solve by doing that?
by
Reduce load on the server generated by users not logged in.
by
+1
Install and configure memcached. See https://www.question2answer.org/qa/71050
by
The `memcached` option I am aware, but I don't care to refresh the cache except maybe once a day or something. My experience with `memchached` is it will refresh the cache every time something is changed, as @Zeeshan is addressing with the linked GitHub project.

3 Answers

–2 votes
by
i'dont think so ....... it's difficult !
+1 vote
by
by
It really needs an issues section. At the very least, users can resolve issues within the issue, even if the code is never officially updated.
+1 vote
by

Yes, it is possible if your site is hosted on a server using litespeed(or LSCache). Enable LSCache and then configure the Htaccess file as below.

<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{REQUEST_URI} !admin|question|login|user|ask|categories|feed [NC]
#If there is no login
RewriteCond %{HTTP_COOKIE} !qa_session
RewriteCond %{ORG_REQ_URI} !^/$
RewriteRule .* - [E=Cache-Control:max-age=86400]
</IfModule>

by
Ah, thank you. That eventually lead me to the OpenLiteSpeed vs LiteSpeed page, and it looks like the Open version doesn't support htaccess, though there is a free license for <2GB servers and one domain. While not ideal, I could make it work in this case.

https://www.litespeedtech.com/products/litespeed-web-server/editions
by
Openlitespeed version supports htaccess. I used Openlitespeed + cyberpanel on the server before. You can make htaccess changes via cyberpanel.

If we sort it as a performance(for q2a);
apache <Openlitespeed <litespeed
by
Will this work if I am using two different versions of webpage for mobile and desktop ?
by
If you want, you can only cache for mobile.
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Mobile|Opera Mini|Fennec|Windows Phone"

I don't know how to do it separately for both.
...