cancel
Showing results for 
Search instead for 
Did you mean: 

BSP Cache

Former Member
0 Kudos
420

Hi,

I want to have an infinite cache duration of some of my BSP pages. But I could only achieve maximum of one day (86400sec). How can I increase this setting ?

thanks in advance and excuse for posting here once more,

this may be the better group, following a hint from Raja

Wolfgang

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

You are in the right place now. Did you check the link which i have given.

Regards

Raja

Former Member
0 Kudos

Hi,

as far as I understand, its the server cache.

I want to increase client cache expiration date.

In the BSP configuration tab, I can input a time of max. 86400 seconds. This works, I find the expiration date in browser cache : 1 day. Is there a way out ?

Former Member
0 Kudos

Try to set the caching "manually" within the OnInitialization.

Example:

response->set_header_field( name = 'Expires' value = 'Thu, 01 Dec 2020 00:00:00 GMT' ).

See also:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Former Member
0 Kudos

Hi to all responders,

Server caching is not the point, I want client side caching. I tried to switch a bsp containing javascript stateless, but it doesn't work. The URL of the page in cache always contents the mangling code like host:application(fvDEnkD==)/scripte/scripte.js

Is there a possibility to avoid this to get session-independent client caching ?

Ciao

Wolfgang

Former Member
0 Kudos

Hi Wolfgang,

my response was exacltly about the client-side caching.

However my method will not work for MIME objects (the script in your case unless it is generated dynamically).

Concernin your last question:

Caching is always done for the concrete URL. So in your case this is normal that the whole URL (including mangled part) is stored.

Could you please explain the problem more exactly.

Do you want to exclude the session information from the URL? - normally it is NOT in the URL unless you are using the sap-syscmd=nocookie option.

Also please see this thread regarding the MIME caching

Artem.

former_member181879
Active Contributor
0 Kudos

Wolfgang,

The answers from Artem has been 110% correct. They are worth reading once more. In principle put all of your JS script onto a BSP page. Then in OnInit method, first delete all the header fields from the response that says that the document should not be cached (see my weblog on handling on non-HTML documents). Then add the correct new headers to cache you page as you wish. And yes, we are talking about browser side caching. Artem has given you all the relevant references. (To build correct date sequences, look at cl_bsp_utility class!)

As for the mangling, there is usually no session-id in this string. See other weblog on this topic. This should not be a problem.

The alternative, maybe much better approach is to place JS into MIME repository. Use the right-mouse, then other functions, and the set the browser cache time of document to 7+ days. This documents can also be read (and will then be cached) without mangled URLs.

Former Member
0 Kudos

Hi, all,

thanks for your answers.

My remark about client side caching was an answer to Naresh, not to Artem.

I changed Artem's advice to:

<b>response->set_header_field( name = 'Cache-Control' value = 'max-age=1209600' ).</b>

and this works if I delete the browser cache time in the property sheet.

I tried the proposal with mime types too. It works, but if I do this I loose version management.

Mangled URL: I changed the path to an absolute one and I got 2 files in cache with mangling code. If I compress,

I got one small with and one large without mangling code.

Funny.

thanks to all.

Wolfgang

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Wolfgang

Check Profile paramter

icm/HTTP/server_cache_<xx>/expiration

Hope it helps

Regards

Naresh