Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Networking, Protocols & Data Formats

CommitUrlCacheEntry Function


Stores data in the specified file in the Internet cache and associates it with the given URL.

Syntax

BOOL CommitUrlCacheEntry%(
    IN LPCTSTR% lpszUrlName,
    IN LPCTSTR% lpszLocalFileName,
    IN FILETIME ExpireTime,
    IN FILETIME LastModifiedTime,
    IN DWORD CacheEntryType,
    IN LPHACK lpHeaderInfo,
    IN DWORD dwHeaderSize,
    IN LPCTSTR% lpszFileExtension,
    IN LPCTSTR% lpszOriginalUrl
); 

The actual syntax of this function varies between its ANSI and Unicode implementations. See the Win32 Internet Functions Syntax document for details.

Parameters

lpszUrlName
Address of a string variable that contains the source name of the cache entry. The name string must be unique and should not contain any escape characters.
lpszLocalFileName
Address of a string variable that contains the name of the local file that is being cached. This should be the same name as that returned by CreateUrlCacheEntry.
ExpireTime
FILETIME structure that contains the expire date and time (in Greenwich mean time) of the file that is being cached. If the expire date and time is unknown, set this parameter to zero.
LastModifiedTime
FILETIME structure that contains the last modified date and time (in Greenwich mean time) of the URL that is being cached. If the last modified date and time is unknown, set this parameter to zero.
CacheEntryType
Unsigned long integer value that contains the cache type bitmask. Currently, the cache entry type values have not been finalized, so this value does not serve a real purpose at this point, except for STICKY_CACHE_ENTRY. This can be a combination of the following values:
COOKIE_CACHE_ENTRY
EDITED_CACHE_ENTRY
NORMAL_CACHE_ENTRY
SPARCE_CACHE_ENTRY
STICKY_CACHE_ENTRY
TRACK_CACHE_ENTRY
TRACK_OFFLINE_CACHE_ENTRY
TRACK_ONLINE_CACHE_ENTRY
URLHISTORY_CACHE_ENTRY

The STICKY_CACHE_ENTRY type is used to make cache entries exempt from scavenging. The default exempt time for entries set using CommitUrlCacheEntry is one day. The exempt time can be changed using the SetUrlCacheEntryInfo function.

lpHeaderInfo
Address of the buffer containing the header information. If this parameter is not NULL, the header information is treated as extended attributes of the URL and is returned in the INTERNET_CACHE_ENTRY_INFO structure.
dwHeaderSize
Unsigned long integer value that contains the size of the header information. If lpHeaderInfo is not NULL, this value is assumed to indicate the size of the buffer to store the header information. An application can maintain headers as part of the data and provide dwHeaderSize together with a NULL value for lpHeaderInfo.
lpszFileExtension
Address of a buffer that contains information maintained in the cache database for future use. In this version of Win32® Internet functions, this information is not used.
lpszOriginalUrl
Address of a string variable that contains the original URL if redirection has occurred.

Return Value

Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError. Possible error values include:

ERROR_DISK_FULL The cache storage is full.
ERROR_FILE_NOT_FOUND The specified local file is not found.

Remarks

If the cache storage is full, CommitUrlCacheEntry invokes cache cleanup to make space for this new file. If the cache entry already exists, the function overwrites the entry if it is not in use. An entry is in use when it has been retrieved with either RetrieveUrlCacheEntryStream or RetrieveUrlCacheEntryFile.

Clients who add entries to the cache should set the headers to at least "HTTP/1.0 200 OK\r\n\r\n"; otherwise, Microsoft® Internet Explorer and other client applications that are utilizing the Win32 Internet functions will disregard the entry.

Function Information

Windows NT Use version 4.0 and later. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)

See Also

Microsoft Win32 Internet Functions Overview, Caching, Microsoft Win32 Internet Functions Reference, Persistent URL Cache Functions, CreateUrlCacheEntry


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site