Forum Moderators: phranque
ExpiresByType application/ld+json “access plus 0 seconds” ExpiresByType application/ld+json “access plus 0 seconds”
This actually disables browser caching at all!? This may make sense for continously changing data, but JSON-LD-code for structured data? Why not choosing “access plus 1 month” for example?
Usually you create your structured data for a certain page, insert it and it won't be changed unless the page itsself changes remarkably.
if the JSON-LD snippet is inserted in your page, it will be compressed and cached if and as the containing document is compressed/cached, so this ExpiresByType directive would be irrelevant.
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
.......
</script> <IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType audio/mpeg "access plus 1 month"
ExpiresByType audio/mp4 "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/rtf "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/zip "access plus 1 month"
ExpiresByType application/msword "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
</IfModule> The JSON-LD snippets exists directly in my page code
What do you mean with "containing document"? The Wordpress-page?
But isn't it normal to have the cached stuff within the page, like jpgs?
I intend to add a line
ExpiresByType application/ld+json "access plus 1 month"
And the containing document, the WP-page, is usually cached automatically by browsers, so I don't need to initiate its cacheing explicitly via htaccess?