Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
sobrenome Posted August 5, 2022 Posted August 5, 2022 I want to serve cached pages for guests directly from Cloudfront cache (first hit). No origin request. On pages requests IPS sends these headers (using Redis as cache method and 1 hour caching for guests on AdminCP😞 cache-control: no-cache="Set-Cookie", max-age=3600, public, s-maxage=3600, stale-while-revalidate, stale-if-error set-cookie: ips4_IPSSessionFront=75kv76vm8so67kh861iqhu7jky; path=/; secure; HttpOnly To cache pages on Cloudfront, these headers should not be sent: no-cache="Set-Cookie" and set-cookie: ips4_IPSSessionFront=75kv76vm8so67kh861iqhu7jky; path=/; secure; HttpOnly. I don't care about users online counter and don't use any guest posting feature. Guests can only read content. There is no interaction for guests. For them, serving "static pages" from the CDN is fine for some minutes, what would be much more faster and less resource intensive. Is there a constants.php setting to remove the set-cookie (IPSSessionFront) for guests?
sobrenome Posted August 7, 2022 Author Posted August 7, 2022 Does anyone know in which php file ips4_IPSSessionFront is set for guests? SeNioR- 1
Adlago Posted August 7, 2022 Posted August 7, 2022 Using this guest page cache is a very bad idea in my opinion. Yes, what you wrote can probably be done - I don't know how, but you try reflect on a possible situation (I have observed such - and with less cache time) - what I mean. You want to use one hour of cache - but after that one hour, if a user with a slow internet connection is the first creator of that page - then for the next one hour, your guests will see a very bad version of your site... no matter where ( in the case as you say - cloud cache) they will receive this. If you want your guests to receive limited, but high-quality (and probably much faster, due to the limited content of your main site), then use conditionals of the type - "if the user is registered - this, if not ... " etc. This practice will save you resources for guests, and better performance such as site loading speed for example. sobrenome 1
Marc Posted August 8, 2022 Posted August 8, 2022 I have moved this to our developer area for you, as this is custom development rather than standard support. sobrenome 1
sobrenome Posted August 8, 2022 Author Posted August 8, 2022 9 hours ago, Marc Stridgen said: I have moved this to our developer area for you, as this is custom development rather than standard support. Thanks Marc. Is it on Home > Forums > Developers > Customization Resources > Development Assistance? Could not find there.
sobrenome Posted August 11, 2022 Author Posted August 11, 2022 On 8/7/2022 at 4:50 PM, sobrenome said: Does anyone know in which php file ips4_IPSSessionFront is set for guests? Anyone?
Ryan Ashbrook Posted September 19, 2022 Posted September 19, 2022 There is no way to prevent that cookie from being set, because it is being set by PHP itself (we use the built-in PHP session handling with a custom handler to push them to the database). You should be able to configure your Cloudfront distribution to ignore that particular cookie for caching purposes, however, though this is unfortunately not something we can assist with. sobrenome and SeNioR- 2
Recommended Posts